In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "what types of jquery selectors are divided into". In daily operation, I believe many people have doubts about what types of jquery selectors are divided into. The editor consulted all kinds of data and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what types of jquery selectors are divided into?" Next, please follow the editor to study!
Jquery four kinds of selector: 1, basic selector, including id selector, element selector, class selector, group selector; 2, hierarchical selector, through the hierarchical relationship between DOM elements to obtain elements; 3, filter selector; 4, form selector.
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
Advantages of jQuery selector:
(1) the code is simpler
(2) support CSS1 to CSS3 selector
(3) perfect handling mechanism.
Classification of jQuery selectors:
1) basic selector
The basic selector is the most frequently used selector in jQuery, and it is composed of elements Id, class, element name, and multiple element characters (group selector).
2) hierarchical selector
The hierarchical selector acquires elements through the hierarchical relationship between DOM elements. The main hierarchical relationships include father-son, offspring, neighbors, and brothers.
3) filter selector
① simple filter selector
Filter selector matches elements according to certain filter rules, and starts with (:) when writing; simple filter selector is the most widely used filter selector.
$("div:first") select the first element of all elements $("div:last") select the last element of all elements $("input:not (.myClass)") select elements whose class is not myClass $("input:even") select elements whose index is even (index starts at 0 ) $("input:odd") selects elements whose index is cardinality (index starts at 0) $("input:eq (2)") selects elements whose index is equal to 2 ("input:gt (4)") selects elements whose index is greater than 4 ("input:lt (4)") selects elements whose index is less than 4 Element $(": header") filters out all title elements For example, $("div:animated"), such as H2, h3, h4, etc., select the element $(": focus") that is animating and select the element that is currently in focus.
② content filter selector
The content filter selector acquires the element according to the text content or the sub-element characteristics contained in the element, and its text content can be blurred or absolutely matched to locate the element.
③ visibility filter selector
The visibility filter selector gets the element according to whether the element is visible or not.
④ attribute filter selector
⑤ child element filter selector
⑥ form object property filter selector
The main purpose of this selector is to filter the selected form elements, such as selecting selected drop-down boxes, multi-checkboxes, and so on.
4) form selector
At this point, the study on "what types of jquery selectors are divided into" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.