'cloneNode()' Example : cloneNode « Node Operation « JavaScript DHTML






'cloneNode()' Example

    
<html>
<body>
<script language="JavaScript">
function function1(){
    var myNode = myButton.cloneNode(true);
    alert(myNode.innerHTML); 
} 
</script>
<button id="myButton" onclick="function1();">Clone node</button>
</body>
</html>

    
      
      








Related examples in the same category