In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
In this article, the editor introduces in detail "what is the concept of prev in jquery", the content is detailed, the steps are clear, and the details are handled properly. I hope this article "what is the concept of prev in jquery" can help you solve your doubts.
In jquery, prev means to return the previous sibling element; this method is used to return the previous element that shared the same parent element, and the method returns only one element, traversing back along the previous sibling element of the DOM element, with the syntax "element object .prev (selector expression searching for the scope of the previous sibling element)".
The operating environment of this tutorial: windows10 system, jquery3.2.1 version, Dell G3 computer.
What is the meaning of prev in jquery
The prev () method returns the previous sibling of the selected element.
Sibling elements are elements that share the same parent element.
Note: this method returns only one element.
DOM tree: this method traverses backwards along the previous sibling of the DOM element.
Related methods:
PrevAll ()-returns all sibling elements before the selected element
PrevUntil ()-returns all sibling elements before each element between two given parameters
The syntax is:
$(selector) .prev (filter)
Filter is optional. Specifies a selector expression that narrows the search for the previous sibling element.
Examples are as follows:
123.siblings * {display: block;border: 2px solid lightgrey;color: lightgrey;padding: 5pxt margin: 15px;} $(document) .ready (function () {$("li.start"). Prev (). Css ({"color": "red", "border": "2px solid red"});}) Ul (parent node) li (sibling node) li (last sibling node of li node with class name "start") li (li node with class name "start") li (sibling node) li (sibling node)
Output result:
After reading this, the article "what is the concept of prev in jquery" has been introduced. If you want to master the knowledge of this article, you still need to practice and use it to understand it. If you want to know more about related articles, please follow the industry information channel.
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.