There are many jquery selectors. There are many ways to select a DOM. How can we exclude a certain element set? The following are examples:
(1) Select All img elements to exclude the number of elements in class = phpernote:
$ ('Img: not (. phpernote) '). length (); // or $ ('img'). not ('. phpernote'). length ();
(2) obtain the number of li elements without class = com under id = phpernote
$ ('# Phpernote li: not (. com )'). size (); // or $ ('# phpernote li '). not ('. com '). length ();
(3) set the background of the li element of all odd rows under id = phpernote
$ ('# Phpernote li'). not (': even'background .css ('background-color', 'red ');
For details about the usage of the jquery selector, refer to this site:
JQuery selector usage Summary
Articles you may be interested in
- Using JavaScript to prohibit browsers from directly copying article content
- Php clears the null element in the array.
- How does jquery operate on iframe parent page elements?
- How to insert an element to the front of the body element in js
- JQuery selector usage Summary
- Jquery obtains the index number of the current element in the Peer element.
- How to locate, eliminate and avoid MySQL database performance problems
- How does php Delete the first and last elements of an array?