jQuery parentsUntil 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(){ $( "#parentsUntilExample" ).on( "click", function(event) { $("span").parentsUntil(".level-one").css("border","1px solid red"); }); }); </script> </head> <body> <ul class='level-one'> <li> First Item</li> <li> Second Item</li> <li> Third Item</li> <li> Fourth Item</li> <li> <ul > <li>Item 1</li> <li>Item 2</li> <li> <p><span>Find My Parents </span></p> </li> </ul> </li> </ul> <h4><a href="javascript:void(0);" id="parentsUntilExample">Click to run parentsUntil() 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(){ $( "#parentsUntilExample" ).on( "click", function(event) { $("span").parentsUntil(".level-one").css("border","1px solid red"); }); }); </script> </head> <body> <ul class='level-one'> <li> First Item</li> <li> Second Item</li> <li> Third Item</li> <li> Fourth Item</li> <li> <ul > <li>Item 1</li> <li>Item 2</li> <li> <p><span>Find My Parents </span></p> </li> </ul> </li> </ul> <h4><a href="javascript:void(0);" id="parentsUntilExample">Click to run parentsUntil() Example </a></h4> </body> </html>
Copyrights@tutorialsplane.com