| 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 |