$(':input') selects all input elements including:
input, select, textarea, button, image, radio and more.
$(:input') and $(input') are different, the second one will only select INPUT element but not others
Demo Example:
Other Notes:
1. More efficient way to select is like $('#form1 :input') with ID selector
2. There are more selectors for form elements, can refer to below
http://api.jquery.com/category/selectors/
:button Selector
Selects all button elements and elements of type button.
沒有留言:
張貼留言