I\'d like to know more about using data-* attributes with HTML and its use within jQuery. I\'m simply trying to retrieve data-attribute-name=\"a value\" with .data() and
You can find any element attribute using
$("#someID").attr('attr1') [or] $("#someID").attr('data-attr-1');
to target based on if the element has the attribute, you can do:
$("[attr1]") or $("[attr1='this is attr 1']") , which will return the element (not the attribute value)
$("[attr1]") or $("[attr1='this is attr 1']")