JQuery has loads of selectors that can be used to select an HTML Element from a page.
One of the common scenario with development for even a simple case of validation requires to check for input fields and to do so we can use a selector that selects the Input field with a given name.
Using the selector we can select a field in HTML a in example below.
<input type="text" name="myField" value="myValue" />
To get the value of this Input we can use code
$("input[name='myField']).val() // which is myValue
Hope this helps.
0 Comment(s)