jQuery find element by data attribute value
Use Attribute Equals Selector Fiddle Demo .find() it works down the tree Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
Use Attribute Equals Selector Fiddle Demo .find() it works down the tree Get the descendants of each element in the current set of matched elements, filtered by a selector, jQuery object, or element.
Look in to jQuery Selectors :contains is a selector here is info on the :contains selector
What is the difference between href and data-href attribute in html <a></a> tag? My current code is written below: and when I’m changing it to it’s not redirecting to verify_phone_process_1.html page.
You have to inject the value of current into an Attribute Equals selector: For older JavaScript environments (ES5 and earlier):
You need to access the dataset property: Result:
To get the contents of the attribute data-id (like in <a data-id=”123″>link</a>) you have to use or .data() (if you use newer jQuery >= 1.4.3) and the part after data- must be lowercase, e.g. data-idNum will not work, but data-idnum will.