Home  >  jQuery

jQuery Contains Word Selector

February 25, 2013
jQuery API provides the way that we can select a matching word in the attribute value. To identify that only match with word, it checks the space before the word is there should not be other character.
<!DOCTYPE html>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<input type="button" name="xy"/>
<input type="button" name="ab xy"/>
<input type="button" name="axybd"/>
<input type="button" name="abxcy"/>

In the example the input string is xy. Now we have four input element. Only first and second is fulfilling the requirement.


©2022 concretepage.com | Privacy Policy | Contact Us