The basic selectors in jquery are: 1. ID selector, which matches an element based on a given ID; 2. Element selector, which matches all elements based on a given element name; 3. Class selector, Match elements according to the given class; 4. Wildcard "*" selector, which can match all elements; 5. Union selector.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
According to the different elements in the obtained page, jQuery selectors can be divided into four major categories: basic selectors, hierarchical selectors, filter selectors, and form selectors.
There are 5 basic jQuery selectors, which consist of element ID, element name, and multiple selectors. Most page elements can be searched through basic selectors
Selector | Function Description |
---|---|
ID Selector#id
|
Match an element based on the given ID |
Element (tag) selector element
|
Match all elements based on the given element name |
Class selector.class
|
Matches elements based on the given class |
Wildcard* Selector |
Match all elements |
Union selector selector1, selector2,...,selectorN
|
Match each selector to the elements and return them together |
Recommended related video tutorials: jQuery Tutorial (Video)
The above is the detailed content of What are the basic selectors in jquery. For more information, please follow other related articles on the PHP Chinese website!