jQuery siblings method
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#siblingsExample" ).on( "click", function(event) { $(".my-siblings").siblings().css({"border":"1px solid red","background":"yellow"}); }); }); </script> </head> <body> <ul > <li> First Item</li> <li class='level-two'> Second Item</li> <li class="my-siblings"> Third Item (Find my Siblings)</li> <li> Fourth Item</li> <li> Fifth Item</li> </ul> <h4><a href="javascript:void(0);" id="siblingsExample">Click to run siblings() Example </a></h4> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#siblingsExample" ).on( "click", function(event) { $(".my-siblings").siblings().css({"border":"1px solid red","background":"yellow"}); }); }); </script> </head> <body> <ul > <li> First Item</li> <li class='level-two'> Second Item</li> <li class="my-siblings"> Third Item (Find my Siblings)</li> <li> Fourth Item</li> <li> Fifth Item</li> </ul> <h4><a href="javascript:void(0);" id="siblingsExample">Click to run siblings() Example </a></h4> </body> </html>
Copyrights@tutorialsplane.com