has-attr
v1.0.3
Published
Checks wheter attribute is present in given object
Downloads
3
Maintainers
Readme
has Attr
JQuery plugin which adds new simple functionality :
- hasAttr - checks wheter attribute is present on given element(s)
- hasData - checks wheter given data attribute is present on given element(s)
Usage
hasAttr
Arguments:
Name:string - name of the attribute
Returns:
True when attribute is present, otherwise false.
Example:
<p id="test" class="test">something</p>
$("#test").hasAttr("class")
returns true
hasData
Arguments:
Name:string - name of the data
Returns:
True when attribute is present, otherwise false.
Example:
<p id="test" data-test>something</p>
$("#test").hasData("test")
returns true