Adding two tables dynamically - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:append

Description

Adding two tables dynamically

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.7.1.js"></script> 
  <style id="compiled-css" type="text/css">

table {// w  w w  . ja  v  a 2  s.co  m
   display: inline-block;
}


      </style> 
  <script type="text/javascript">
    $(window).load(function(){
 var str = "<table><tr><td>Hello</td></tr></table>";
 $('body').append(str+str);
    });

      </script> 
 </head> 
 <body>  
 </body>
</html>

Related Tutorials