Reputation: 145
Please describe how to refer tag using my custom attribute using jQuery.
I have tag like this :
<a user="kasun" href="#" id="id1">Show More...</a>
I want to refer tag without refering id. like
$('#id1')
I want to refer it like:
$('#user')//this is wrong. I mentioned this code only for understand what I mean.
Thank You.
Upvotes: 0
Views: 41
Reputation: 309
I would agree with Amiros answer. I would like to give one more option to select those elements which are having custom attribute in ONLY anchor tags.
$("a[user]")
$("a[user='kasun']")
Upvotes: 0