Javascript Selecting Form Elements Using Name Attribute
Is it possible to select a form element using it's name attribute? For example if I had something like this: How would I go about se
Solution 1:
Your almost there
var name_val = $('input[name=my_element]').val();
Solution 2:
var name_val = $('input[name="my_element"]').val();
Solution 3:
The following should work:
var name_val = $('input[name="my_element"]').val();
Post a Comment for "Javascript Selecting Form Elements Using Name Attribute"