These type of selectors are used to match elements based on
the element name.
:input
This
will find all input, buttons, text area and select elements.
$(":input")
This
finds all the input elements.
:text
This
matches all input elemets that are of type text i.e. text boxes. The syntax is
like this :
$(":text")
This
selector is equivalent to
$("*:text").
These type of selectors are considered to be
slower selectors. So it is recommended to always use $("input:text"). So that first it will match all the input elements and then
will match for the text boxes in all the input elements in stead of finding in
the whole document. So this becomes more convinient.
:password
This
matches all password elements or controls. The syntax is :
$("input:password")
So it
finds input controls which are of password type.
:radio
This
matches all input elements of type radio.
This
selector is equivalent to
$("*:radio").
These type of selectors are considered to be
slower selectors. So it is recommended to always use $("input:radio"). So that first it will match all the input elements in and
then will match for the radio buttons in all the input elements in stead of
finding in the whole document.
$("input:radio")
:checkbox
This Matches all input elements of type checkbox.
$(":checkbox")
This
selector is equivalent to
$("*:checkbox").
These type of selectors are considered to be
slower selectors. So it is recommended to always use $("input:checkbox"). So that first it will match all the input elements in and
then will match for the checkboxes in all the input elements in stead of
finding in the whole document.
:submit
Matches
all input elements of type submit. This is the syntax :
$(":submit")
It
will not match the button controls which are type button. It only
matches the buttons which are type submit.
:image
Matches
all input elements of type image. The syntax is
$(":image")
:reset
Matches
all input elements of type reset. The syntax is :
$(":reset")
This
will match all the reset type buttons which are generally used to clear
out all the elements in the page.
:button
This
matches all button elements and input elements of type button.
$(":button")
This
will find the button controls which are written like
<button></button> and the input elements of type button like
<input type='button'> as well.
:file
Matches
all input elements of type file.
$(":file")
This
will find all the file type controls used for uploading files in a page.
:hidden
This
will find all the hidden elements.
$("input:hidden")
The
above code will find all the hidden input elements.