Jquery selector instance Manual

Source: Internet
Author: User
Selector Instance Select
* $ ("*") All elements
#ID $ ("# Lastname ") Id = "lastname" element
.Class $ (". Intro ") All class = "Intro" Elements
Element $ ("P ") All <p> Elements
.Class.Class $ (". Intro. Demo ") All class = "Intro" and class = "Demo" Elements
     
: First $ ("P: First ") First <p> element
: Last $ ("P: Last ") Last <p> element
: Even $ ("TR: Even ") All even <tr> Elements
: Odd $ ("TR: odd ") All odd <tr> Elements
     
: Eq (Index) $ ("Ul Li: eq (3 )") The fourth element in the list (index starts from 0)
: GT (No) $ ("Ul Li: GT (3 )") List elements with an index greater than 3
: Lt (No) $ ("Ul Li: Lt (3 )") List elements whose index is less than 3
: Not (Selector) $ ("Input: Not (: Empty )") All input elements not empty
     
: Header $ (": Header ") All title elements
: Animated   All animation Elements
     
: Contains (Text) $ (": Contains ('w3school ')") Contains all elements of a specified string
: Empty $ (": Empty ") All elements of a node without child (element)
: Hidden $ ("P: hidden ") All hidden <p> Elements
: Visible $ ("Table: visible ") All visible tables
     
S1, S2, S3 $ ("Th, TD,. Intro ") All elements with matching Selection
     
[Attribute] $ ("[Href]") All elements with href attributes
[Attribute=Value] $ ("[Href = '#']") The value of all href attributes is equal to the "#" element.
[Attribute! =Value] $ ("[Href! = '#'] ") The values of all href attributes are not equal to "#" elements.
[Attribute$ =Value] $ ("Your href00000000'.jpg ']") The values of all href attributes contain elements ending with ". jpg ".
     
: Input $ (": Input ") All <input> Elements
: Text $ (": Text ") All <input> elements of type = "text"
: Password $ (": Password ") All <input> elements of type = "password"
: Radio $ (": Radio ") All <input> elements of type = "radio"
: Checkbox $ (": Checkbox ") All <input> elements of type = "checkbox"
: Submit $ (": Submit ") All <input> elements of type = "Submit"
: Reset $ (": Reset ") All <input> elements of type = "reset"
: Button $ (": Button ") All <input> elements of type = "button"
: Image $ (": Image ") All <input> elements of type = "image"
: File $ (": File ") All <input> elements of type = "file"
     
: Enabled $ (": Enabled ") All activated input Elements
: Disabled $ (": Disabled ") All disabled input Elements
: Selected $ (": Selected ") All selected input Elements
: Checked $ (": Checked ") All selected input Elements

For more Tutorial: jquery element selector syntax

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.