jQuery html 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(){ $( "#htmlExample" ).on( "click", function(event) { var data = $("div").html(); alert(data); }); }); </script> <style> div{ margin:10px; height:100px; width:100px; border:2px solid red; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="htmlExample">Click to run .html() Example </a></h4> <div>Hello World! <p>My Para</p> <span>My Span</span> </div> </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(){ $( "#htmlExample" ).on( "click", function(event) { var data = $("div").html(); alert(data); }); }); </script> <style> div{ margin:10px; height:100px; width:100px; border:2px solid red; float:left; } </style> </head> <body> <h4 ><a href="javascript:void(0);" id="htmlExample">Click to run .html() Example </a></h4> <div>Hello World! <p>My Para</p> <span>My Span</span> </div> </body> </html>
Copyrights@tutorialsplane.com