'appendChild()' Example : appendChild : Javascript Methods : JavaScript Reference examples (example source code) Organized by topic

JavaScript Reference
C++
PHP
JavaScript Reference Home »  Javascript Methods   » [  appendChild  ]   
 



'appendChild()' Example

    
<html>
<body>
<script language="javascript">
function function1(){
   var myElement = document.createElement('<div style="width:600; height:200;background-color:blue;">www.java2s.com</div>');
   document.all.myBody.appendChild(myElement)

</script>
<body id="myBody"><button onclick="function1();">Append child</button></body>
</body>
</html>

    
      
      
Related examples in the same category
1.  'appendChild()' Syntax, Parameters and Note
2.  'appendChild()' is applied to
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.