(p)") Select All div elements containing the p tag$ ("Td: parent") Select All element arrays with td as the parent nodeVisual filter selector:
$ ("Div: hidden") select all the div elements to be hidden.$ ("Div: visible") Select All visualized div elementsAttribute filter selector:
$ ("Div [id]") Select All div elements containing the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to '
elements containing the id attribute
HTML code:
Hello!
JQuery code:$ ("P [id]")
Result:[
]
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
Parameters
Attribute(String): attribute name
Value(String): attribute value. Quotation marks are optional in most cases. However, it
$= ' Man ']")Find all input elements with name ' man '$ ("input[name*= ' Man ']")Find all input elements with name ending with ' letter '$ ("input[name$= ' letter ']")Find all input elements with name start with ' News '$ ("input[name^= ' News ']")Find all the name attribute is not a newsletter INPUT element$ ("input[name!= ' newsletter ')"). attr ("Checked", true);Find all the name attribute is the INPUT e
the div
$ (Td: empty) Select an array of all td elements that are empty (and do not include text nodes)
$ (Div: has (p) Select All div elements containing the p tag
$ (Td: parent) Select All element arrays with td as the parent node
Visual filter selector:
$ (Div: hidden) select all the div elements hidden
$ (Div: visible) Select All visualized div elements
Attribute filter selector:
$ (Div [id]) Select All div elements containing the id attribute
$ (Input [name = '
the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to 'newsletter'.
$ ("Input [name! = 'Newsletter'] ") Select the input element whose name attribute is not equal to 'newsletter '.
$ ("Input [name ^ = 'News']") select all input elements whose name attributes start
elements that are empty (or contain text nodes)
$ ("P: has (p)") select all p elements containing p tags
$ ("Td: parent") Select All element arrays with td as the parent node
Visual filter selector:
$ ("P: hidden") select all hidden p elements.
$ ("P: visible") Select All visualized p elements
Attribute filter selector:
$ ("P [id]") select all p elements containing the id attribute
$ ("Input [name = 'newsletter ']") Select the input element whose n
the visual div element properties of the filter selector: $ ("Div[id]"Select all DIV elements that contain the id attribute $ ("Input[name= ' newsletter ')" selects all the name attributes equal to ' newsletter 'the INPUT element $ ("input[name!= ' newsletter ')" selects all name attributes not equal to ' newsletter '
FilterAttribute Filters
Name
Description
Example
[Attribute]
Match the element containing the given property
Find all DIV elements containing ID attributes: $ ("div[id]")
[Attribute=value]
Matches a given property as an element of a particular value
Find all the name attribute is the INPUT element of newsletter: $ ("input[name= ' newsletter
(4)") Select all TD elements in the TD element with an ordinal greater than 4 $ ("Td:ll (4)") selects all TD elements in the TD element with an ordinal less than 4 $ (": Header") $ ("div:animated") Content Filter Selector:$ ("Div:contains (' John ')") Select all the elements in the div that contain the John text$ ("Td:empty") Select all the arrays of TD elements that are empty (nor include text nodes)$ ("Div:has (P)") Select all DIV elements that contain p tags$ ("td:parent") Select all
This article mainly introduces a small example of jquery searching based on the name attribute. If you need it, refer to it.
The Code is as follows:
$ ("P [id]") select all p elements containing the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to 'newsletter'.$ ("Input [name! = 'Newsletter'] ") Select
") Select All visualized p elements
Attribute filter selector:$ ("P [id]") select all p elements containing the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to 'newsletter'.$ ("Input [name! = 'Newsletter'] ") Select the input element whose name attribute is not equal to '
div elements attribute filter selector: $ (" Div[id] ") Select all DIV elements with id attribute $ ("Input[name=" Newsletter '] ") Select all the name attribute equals ' newsletter ' INPUT element $ (" input[name!= ' newsletter '] ") Select all the name attribute is not equal to ' newsletter ' INPUT element $ ("i
elements to be hidden.$ ("Div: visible") Select All visualized div elements
Attribute filter selector:
Java code$ ("Div [id]") Select All div elements containing the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to 'newsletter'.$ ("Input [name! = 'Newsletter'] ") Select the input element whose name attribut
div elements attribute filter selector: $ (" Div[id] ") Select all DIV elements with id attribute $ ("Input[name=" Newsletter '] ") Select all the name attribute equals ' newsletter ' INPUT element $ (" input[name!= ' newsletter '] ") Select all the name attribute is not equal to ' newsletter ' INPUT element $ ("i
elements in the div that contain the John text$ ("Td:empty") Select all the arrays of TD elements that are empty (nor include text nodes)$ ("Div:has (P)") Select all DIV elements that contain p tags$ ("td:parent") Select all the element array with TD as parent nodeVisual Filter Selector:$ ("Div:hidden") Select all the hidden div elements$ ("div:visible") Select all of the visual DIV elementsAttribute Filter Selector:$ ("Div[id]") Select all DIV elements that contain the id attribute$ ("input[na
elements containing the ID attribute $ ("input [name = 'newsletter ']") select the input element whose name attribute is equal to 'newsletter' $ ("input [name! = 'Newsletter '] ") select all input elements whose name attribute is not equal to 'newsletter' $ (" input [name ^ = 'News'] ") select all input elements st
Attribute filter selector:$ ("Div [id]") Select All div elements containing the id attribute$ ("Input [name = 'newsletter ']") Select the input element whose name attribute is equal to 'newsletter'.$ ("Input [name! = 'Newsletter'] ") Select the input element whose name attribute is not equal to 'newsletter '.$ ("Inpu
filter selector: 040 041 $ ("div [id]") Select All Div element 042 $ ("input [name = 'newsletter ']") select all name attributes to be equal to the input element 043 044 of 'newsletter' $ ("input [name! = 'Newsletter '] ") Select an input element 045 046 $ (" input [name ^ = 'News'] ") whose name attribute is not equal to that of '
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.