TD as the parent node
5. Visual filter selector:$ ("Div: hidden") select all the DIV elements to be hidden.$ ("Div: visible") Select All visualized DIV elements
6. 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! = '
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 '.
$ ("Input [name ^ = 'News']") select all input elements whose name attri
containing P: $ ("Div: Has (p)"). addclass ("test ");
: Parent
Match an element containing child elements or text
Find all TD elements containing child elements or text: $ ("TD: parent ")
5. Visibility Filter
Visibility Filters
Name
Description
Example
: Hidden
Match all invisible elementsNote: In Version 1.3.2, hidden matches its own or parent class elements that do not occupy space in the document. If the CSS visibility attribute is used so that
hidden.$ ("Div: visible") Select All visualized div elements6. 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 '
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 is used to avoid conflicts when an attribute value contains.Example
Find all input elements whose name attribute is newsletter
HTML code:'JQuery code:$ ("Input [name = '
Selector: $ Panax Notoginseng$ ("div:hidden"Select all of the hidden div elements -$ ("div:visible") Select all of the visual div elements the Attribute Filter Selector: + a$ ("div[id")Select all DIV elements that contain the id attribute the$ ("input[name= ' Newsletter ')" selects all the name attributes equal to ' newsletter 'the INPUT element + -$ ("input[name!= '
input tag element ("#prev ~ div") followed by the label tag directly following the label.
Basic Filter Selector
$ ("Tr:first") selects the first $ ("Tr:last") of all TR elements and selects the last $ ("Input:not (: Checked) + span") of all TR elements
ID Label class
$ ("#myELement") Select an element with an ID value equal to myelement. ID value cannot be repeated in the document only can have an ID value is myelement so get the
index values greater than 0;: LT (Index)Matches all elements that are less than the given index value$ ("Tr:lt (2)")Matches rows with index values less than 2;: HeaderMatch header elements such as H1, H2, H3, etc.$ (": Header"). CSS ("Background", "#EEE");Add background color to all headings in the page: FocusMatches the element that currently gets focus4. Attribute-dependent selectors[]$ ("Div[id]")Find all DIV elements that contain ID attributes[Attribute=value]$ ("input[name= '
elements of the section 1,3,5 ... An element
$ ("Td:eq (2)") select the TD element with the number 2 in all TD elements
$ ("TD:GT (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")
As we all know, when the form is finished, it needs to be printed as well as the document to facilitate circulation. But what if you want to print only a subset of the data in the table? The following small series for you to introduce how the WPS table for the column printing, a look at it.
To the ROM version of the newsletter as an example, the implementation of the "edit" → "move or copy the worksheet", the new
all TR elements of the 0,2,4 ... Element (Note: Since the selected element is an array, the ordinal number is starting at 0)$ ("tr:odd") Select all TR elements of the 1,3,5 ... An element$ ("Td:eq (2)") select the TD element with the serial number 2 in all TD elements$ ("TD:GT (4)") Select all TD elements with serial number greater than 4 in TD elements$ ("Td:ll (4)") Select all TD elements with a serial number less than 4 in the TD elementContent Filter Selector:$ ("Div:contains (' John ')") S
you use the CSS visibility property so that it does not display but occupies a placeholder, you do not enter hidden.
Find all the Invisible TR elements: $ ("Tr:hidden")
: Visible
Match all visible elements
Find all the Visible TR elements: $ ("tr:visible")
6. Attribute FilterAttribute Filters
Name
Description
Example
[Attribute]
Match the element containing the given property
Find all DIV elements that cont
elements that contain ID attributes$ ("input[name= ' newsletter ']") selects all input elements that have the Name property equal to ' newsletter '$ ("input[name!= ' newsletter ']") selects all input elements that are not equal to ' newsletter ' for all name properties $ ("input[name^= ' News") selects all the input e
greater than 4 in TD elements$ ("Td:ll (4)") Select all TD elements with a serial number less than 4 in the TD element$ (": Header")$ ("div:animated")Content Filter Selector:$ ("Div:contains (' John ')") Select elements in all div that contain John text$ ("Td:empty") selects all arrays of TD elements that are empty (and not including text nodes)$ ("Div:has (P)") Select all DIV elements that contain p tags$ ("td:parent") Select all array of elements with TD as parent nodeVisual Filter Selector:$
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 the element array with TD as parent nodeVisual Filter Selector:$ ("Div:hidden") Select all the hidden div elements$ ("div:visible") Sel
The example in this article describes the use of jquery for lookups based on the Name property. Share to everyone for your reference, specific as follows:
$ ("Div[id]")//Select all div element with id attribute
$ ("input[name= ' Newsletter '")//Select all the name attribute equals ' newsletter ' INPUT element
$ (" input[name!= ' newsletter ')//Select INPUT e
1, submit your website to the search engine, so that your site has the possibility of maximum exposure rate;
2, if you expect to get more exposure opportunities, you can pay for search engine marketing (Engine Marketing). When the browser with fixed keyword search, there will be on the search engine site on your site text ads;
3. To carry out a lottery. In a certain amount of time, if someone is registered on your website or subscribe to email newsletter
Copy Code code as follows:
$ ("Div[id]") Select all DIV elements that contain ID attributes
$ ("input[name= ' newsletter ']") selects all input elements that have the Name property equal to ' newsletter '
$ ("input[name!= ' newsletter ']") selects all input elements that are not equal to ' newsletter ' for al
, the visibility of the filter Visibility Filters
: Hidden
: Visible
7, Attribute filter attributes Filters
Name
Description
Example
[Attribute]
Matches the element that contains the given property
Find all DIV elements that contain ID attributes:$ ("Div[id]")
[Attribute=value]
Match the given property is an element of a particular value
Finds the input element for which all name properties are
number 2 in all TD elements $ ("TD:GT (4)") Select all TD elements in the TD element with an ordinal greater than 4 $ ("Td:ll (4)") Select all TD elements with a number less than 4 in the TD element $ (": Header") $ ("div:animated")
Content Filter Selector:
$ ("Div:contains (' John ')") Select elements in all div that contain John text$ ("Td:empty") selects all arrays of TD elements that are empty (and not including text nodes)$ ("Div:has (P)") Select all DIV elements that contain p
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.