Move one content div into another div - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:appendTo

Description

Move one content div into another div

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-2.1.3.js"></script> 
 </head> //w w  w.j  a  v  a2  s . c  o m
 <body> 
  <div id="1"> 
     <script>console.log("test")</script> 
  </div> 
  <div id="2"></div> 
  <script>
 $('#1').children().clone().appendTo('#2');
  </script>  
 </body>
</html>

Related Tutorials