On some tutorials, I’ve seen these selectors:
$(':input');
or
$('input');
Note the ‘:’.
Are there any differences?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
$('input')= with only the element name, selects only HTML elements.$(':input')= with the colon, selects/filter all form input type elements, including input, select, textarea, and button elements.Refer to the jQuery selector information:
http://api.jquery.com/category/selectors/
http://api.jquery.com/input-selector/