Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
176
rated 0 times [  182] [ 6]  / answers: 1 / hits: 198597  / 11 Years ago, fri, november 8, 2013, 12:00:00

Similar to this question here, I'm looking to get an element based on it's data-id.



<a href=# class=whatever data-item-id=stand-out>...</a>



I'm looking to take action on the a tag. It has a shared class amongst many other elements and has no base id, just a data-item-id.



Can the element be found by it's data-item-id or can I only find out what the data-item-id is?


More From » jquery

 Answers
6

You can always use an attribute selector. The selector itself would look something like:



a[data-item-id=stand-out]

[#74402] Thursday, November 7, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
turnerf

Total Points: 620
Total Questions: 101
Total Answers: 109

Location: French Polynesia
Member since Tue, Jul 7, 2020
4 Years ago
turnerf questions
;