jQuery prev method
home
Run
screen_rotation
fullscreen
cloud_download
navigate_next
<!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(){ $( "#prevExample" ).on( "click", function(event) { $(".fourth").prev().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 class="fourth" style="border:1px solid blue;"> Fourth Item(select the privious item of this element)</li> <li> <ul > <li>Item 1</li> <li>Item 2</li> </ul> </li> </ul> <h4><a href="javascript:void(0);" id="prevExample">Click to see prev() 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(){ $( "#prevExample" ).on( "click", function(event) { $(".fourth").prev().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 class="fourth" style="border:1px solid blue;"> Fourth Item(select the privious item of this element)</li> <li> <ul > <li>Item 1</li> <li>Item 2</li> </ul> </li> </ul> <h4><a href="javascript:void(0);" id="prevExample">Click to see prev() Example </a></h4> </body> </html>
Copyrights@tutorialsplane.com