[attribute]
Matches
elements that have the specified attribute like id, title, name, value etc.
$("div[id]")
The
above will match all the divs which has a ID.
[attribute=value]
Matches
elements that have the specified attribute with a certain value.
$("input[class=RedButton]")
The
above example will find all the input elements with the class name RedButton.
Here attribute is 'class' and value is 'RedButton'.
[attribute!=value]
Matches
elements that either don't have the specified attribute or do have the
specified attribute but not with a certain value.
$("input[class!=RedButton]")
The
code will find the input elements which either don't have a class name
attribute or have a class name with a value other then 'RedButton'.
[attribute^=value]
Will
match elements that have the specified attribute and it starts with a certain
value.
$("input[id^='txt']")
This
code will find all the input elements which have an ID and the ID starts with
'txt'. Other input elements which have an ID but don't start with 'txt' will
not be matched.
[attribute$=value]
Matches
elements that have the specified attribute and it ends with a certain value.
$("input[id$='John']")
This
code will find all the input elements which have an ID and the ID ends with
'John'. Other input elements which have an ID but don't start with 'John' will not
be matched.
[attribute*=value]
Will
match the elements that have the specified attribute and it contains a certain
value.
$("input[name*='man']")
The
code will match all the input elements which have the name attribute and the
name attribute contains 'man'.
[attributeFilter1][attributeFilter2][attributeFilterN]
Matches
elements that match all of the specified attribute filters.
$("input[id][name$='man']")
Finds
all inputs that have an id attribute and whose name attribute ends with 'man'.