Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

jquery-has-attr-like

Select DOM elements by testing attribute values with regexes.

jquery, attribute, regex, regexp, dom, element, pattern, search, select, hasClassLike, hasAttrLike

readme

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