there are many
<a href="-sharp" onclick="detail(201,3994123)" data-toggle="modal" data-target="-sharpdetailModal" class="btn btn-xs btn-primary"></a>
<a href="-sharp" onclick="detail(201,3994453)" data-toggle="modal" data-target="-sharpdetailModal" class="btn btn-xs btn-primary"></a>
<a href="-sharp" onclick="detail(201,3991253)" data-toggle="modal" data-target="-sharpdetailModal" class="btn btn-xs btn-primary"></a>
such a tags, in which the common feature of these a tags is that the custom attribute data-toggle is equal to the value of-sharpdetailModal. I now want to get the attribute values of all such a tag onclick attributes. I use jq to get it, written as: $("a [data-target="-sharpdetailModal"]")-> attr ("onclick"), but this only gets the onclick attribute value of the first a tag. I would like to ask what is the reason at this time. Can"t you get the onclick attribute values of all such a tags?