user2276831 user2276831 - 3 years ago 192
jQuery Question

jQuery Attribute Equals Selector without element

How does a jQuery Attribute Equals Selector work without an element to search through?

For example

$("[data-meta=state]").val()

Answer Source

If you want to select all element you have to use the "*" character which means all and after it use the attribute/value pair like the example in this answer

 $("*[data-meta=state]").val();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download