Skip to content

sandinmyjoints/jquery-has-attr-like

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Select elements by testing attribute values with regexes.

Resources

Stars

Watchers

Forks

Packages

No packages published