Create more than one jquery html instance - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:html

Description

Create more than one jquery html instance

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-1.9.1.js"></script> 
  <script type="text/javascript">
    $(window).load(function(){//from   w  w w  .  j av a2s.co  m
var me = $('<div class="me" style="width:100px; height:100px; background-color:red;">Hello</div>');
$("#go1").append(me);
$(me).clone().appendTo("#go2");
$('.me').text("World");
    });

      </script> 
 </head> 
 <body> 
  <div id="go1"></div> 
  <div id="go2"></div>  
 </body>
</html>

Related Tutorials