: Hidden matches all invisible elements. If the type attribute of the input element is "hidden", it will also be matched
Matches all elements that are hidden, or input elements of type "hidden". Return Value
Array <Element>
Example
Search for all invisible tr Elements
HTML code:
<Table>
<Tr style = "display: none"> <td> Value 1 </td> </tr>
<Tr> <td> Value 2 </td> </tr>
</Table>
JQuery code:
$ ("Tr: hidden ")
Result:
[<Tr style = "display: none"> <td> Value 1 </td> </tr>]
Bytes ---------------------------------------------------------------------------------------
: Visible matches all visible elements Matches all elements that are visible. Return Value
Array <Element>
Example
Search for all visible tr Elements
HTML code:
<Table>
<Tr style = "display: none"> <td> Value 1 </td> </tr>
<Tr> <td> Value 2 </td> </tr>
</Table>
JQuery code:
$ ("Tr: visible ")
Result:
[<Tr> <td> Value 2 </td> </tr>]
Bytes ---------------------------------------------------------------------------------------
[Attribute] matches the element containing the given attribute Matches elements that have the specified attribute. Return Value
Array <Element>
Parameters
Attribute(String): attribute name
Example
Search for all div elements containing the id attribute
HTML code:
<Div>
<P> Hello! </P>
</Div>
<Div id = "test2"> </div>
JQuery code:
$ ("Div [id]")
Result:
[<Div id = "test2"> </div>]
Bytes ---------------------------------------------------------------------------------------
[Attribute = value] matching a given attribute is an element of a specific value Matches elements that have the specified attribute with a certain value. returned value
Array <Element>
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it is used to avoid conflicts when an attribute value contains.
Example
Find all input elements whose name attribute is newsletter
HTML code:
'<Input type = "checkbox" name = "newsletter" value = "Hot Fuzz"/>
<Input type = "checkbox" name = "newsletter" value = "Cold Fusion"/>
<Input type = "checkbox" name = "accept" value = "edevil Plans"/>
JQuery code:
$ ("Input [name = 'newsletter ']"). attr ("checked", true );
Result:
[<Input type = "checkbox" name = "newsletter" value = "Hot Fuzz" checked = "true"/>, <input type = "checkbox" name = "newsletter" value = "Cold Fusion" checked = "true"/>]
Bytes ---------------------------------------------------------------------------------------
[Attribute! = Value] matching a given attribute is an element that does not contain a specific value Matches elements that don't have the specified attribute with a certain value. returned value
Array <Element>
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it is used to avoid conflicts when an attribute value contains.
Example
Find all input elements whose name attribute is not newsletter
HTML code:
'<Input type = "checkbox" name = "newsletter" value = "Hot Fuzz"/>
<Input type = "checkbox" name = "newsletter" value = "Cold Fusion"/>
<Input type = "checkbox" name = "accept" value = "edevil Plans"/>
JQuery code:
$ ("Input [name! = 'Newsletter '] "). attr (" checked ", true );
Result:
[<Input type = "checkbox" name = "accept" value = "edevil Plans" checked = "true"/>]
Bytes ---------------------------------------------------------------------------------------
[Attribute ^ = value] matching a given attribute is an element starting with some values Matches elements that have the specified attribute and it starts with a certain value. Return value
Array <Element>
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it is used to avoid conflicts when an attribute value contains.
Example
Find all input elements whose names start with 'new'
HTML code:
<Input name = "newsletter"/>
<Input name = "milkman"/>
<Input name = "newsboy"/>
JQuery code:
$ ("Input [name ^ = 'News']")
Result:
[<Input name = "newsletter"/>, <input name = "newsboy"/>]
Bytes ---------------------------------------------------------------------------------------
[Attribute $ = value] matches the given attribute with elements ending with some values. Matches elements that have the specified attribute and it ends with a certain value. Return value
Array <Element>
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it is used to avoid conflicts when an attribute value contains.
Example
Find all input elements whose names end with 'letter'
HTML code:
<Input name = "newsletter"/>
<Input name = "milkman"/>
<Input name = "jobletter"/>
JQuery code:
$ ("Input [name $ = 'Letter ']")
Result:
[<Input name = "newsletter"/>, <input name = "jobletter"/>]
Bytes ---------------------------------------------------------------------------------------
[Attribute * = value] matching a given attribute is an element that contains certain values. Matches elements that have the specified attribute and it contains a certain value. Return value
Array <Element>
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it is used to avoid conflicts when an attribute value contains.
Example
Find all input elements whose names contain 'man'
HTML code:
<Input name = "man-news"/>
<Input name = "milkman"/>
<Input name = "letterman2"/>
<Input name = "newmilk"/>
JQuery code:
$ ("Input [name * = 'man']")
Result:
[<Input name = "man-news"/>, <input name = "milkman"/>, <input name = "letterman2"/>]
Bytes ---------------------------------------------------------------------------------------
[Selector1] [selector2] [selectorN] composite attribute selector, which must meet multiple conditions at the same time. Matches elements that have the specified attribute and it contains a certain value. Return value
Array <Element>
Parameters
Selector1(Selector): attribute Selector
Selector2(Selector): another property Selector to further narrow down the scope.
SelectorN(Selector): any number of attribute selectors
Example
Find all the attributes that contain id and whose name attributes end with man.
HTML code:
<Input id = "man-news" name = "man-news"/>
<Input name = "milkman"/>
<Input id = "letterman" name = "new-letterman"/>
<Input name = "newmilk"/>
JQuery code:
$ ("Input [id] [name $ = 'man']")
Result:
[<Input id = "letterman" name = "new-letterman"/>]