Jquery select by role Data attribute reference. – BoltClock Commented Jul 25, 2012 at 9:56 W3Schools offers free online tutorials, references and exercises in all the major languages of the web. myClass:contains('My Text')") If you even don't know which element it is (e. Syntax: $( "#id Feb 10, 2021 ยท Is there an easy and straight-forward method to select elements based on their data attribute? For example, select all anchors that has data attribute named customerID which has value of 22. Warning: The select role is an abstract role . I am using jQuery mobile and need to add data-role="none" to all of the <select> tags on the page. How to open a Bootstrap Modal on change of select Box. d = selects nested child d which is inside of div a //. find() is called. $('[data-product-id="456"]') This is a jQuery selector that targets elements with the specific data attribute data-product-id and the value 456. hakimweonwhnpkwmkdrmxkilsjqsnovbhinxiwvsokrtjwddmbwxxaiulmjgittjlciorbpikqkjqijd