jQuery prev method
home
Run
screen_rotation
fullscreen
cloud_download
navigate_before
<!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) { $("p").prev(".para2").css("border","1px solid red"); }); }); </script> </head> <body> <div>Demo Div..........</div> <p>Demo para 1............</p> <p class="para2">Demo para 2............</p> <p>Demo para 2............</p> <p class='para4' >Demo para 4............</p> <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) { $("p").prev(".para2").css("border","1px solid red"); }); }); </script> </head> <body> <div>Demo Div..........</div> <p>Demo para 1............</p> <p class="para2">Demo para 2............</p> <p>Demo para 2............</p> <p class='para4' >Demo para 4............</p> <h4><a href="javascript:void(0);" id="prevExample">Click to see prev() Example </a></h4> </body> </html>
Copyrights@tutorialsplane.com