jquery-has-attr-like

0.0.4 • Public • Published

hasAttrLike

Select elements by testing each value of each element's attribute attr for pattern.

Example

<div class="foobar foobaz"></div>

Find all elements that have a class that ends in "bar".

$("[class$=bar]").length // 0 because "foobar" is not at the end of the `class` attribute.
$("*").hasAttrLike("class", /bar$/).length // 1

Package Sidebar

Install

npm i jquery-has-attr-like

Weekly Downloads

3

Version

0.0.4

License

MIT

Last publish

Collaborators

  • sandinmyjoints