jQuery shortcut for element.innerHTML+= with function() - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

jQuery shortcut for element.innerHTML+= with function()

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <script type="text/javascript" src="https://code.jquery.com/jquery-git.js"></script> 
  <script type="text/javascript">
    $(window).on('load', function() {
$("#html").html(function(i, o) {
  return o + "text";
});//from  w w w.  j  a  v a  2  s. c o m
    });

      </script> 
 </head> 
 <body> 
  <div id="html">
    123 
  </div>  
 </body>
</html>

Related Tutorials