Home  >  jQuery

jQuery Attribute Equals Selector

February 25, 2013
jQuery Equals Selector is a selector that matches the exact word. It does not work with regular expression. There should be exact match as a whole string. This jQuery API helps the developer when we need to assign some value in one go only for exact matched elements. No wildcard is used to use the exact word selector.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<input type="button" name="axy"/>
<input type="button" name="xyb"/>
<input type="button" name="xy"/>

<script>$('input[name="xy"]').val('Nice');</script>
</body>
</html>
 
In the above example only third element is with attribute name value xy. So value will be assigned to that element only.
Output
FIND MORE TUTORILAS






©2019 concretepage.com | Privacy Policy | Contact Us