JQuery, is there a way to select all elements on the page with a specific attribute? -
assuming create like:
<div> <p myattribute='hello'>text</p> .. </div>
i want find on page, elements have myattribute, regardless of are. how do this?
you can use has-attribute selector, example:
$("[myattribute]")
to elements attribute specific value, use attribute-equals selector, this:
$("[myattribute='hello']")
you can find full list of attribute selectors available here.
Comments
Post a Comment