JQuery uses siblings to obtain all siblings of an element. For example, jquerysiblings
This document describes how jQuery uses siblings to obtain all its peers (siblings) of an element. We will share this with you for your reference. The details are as follows:
Siblings () is an API of the jQuery filtering class. It is used to search for all peer elements of an element (all siblings ).
<Div id = "contentHolder"> <input type = "button" value = "1" id = "button1"> </input> <input type = "button" value =" 2 "id =" button2 "> </input> <input type =" button "value =" 3 "id =" button3 "> </input> </div>
If you need to implement the following functions: When you click a button, the background color of the button changes to #88b828, and the background color of other buttons changes to #15b494. At this time, the siblings API is very useful and very simple.
$ (Function () {$ ("# contentHolder input [type = 'click']"). click (function () {certificate (this).css ("background", "#88b828"); Certificate (this).siblings(.css .css ("background", "#15b494 ");});})