'replaceNode()' Example : replaceNode : Node Operation JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Node Operation » replaceNode »

 

'replaceNode()' Example



    
<html>
<body>
<script language="JavaScript">
function function1() {
   var newElement = document.createElement('u');
   newElement.innerHTML = 'Text';
   
   var oldElement = document.all.myBold;
   document.all.myBold.replaceNode(newElement)

</script>
<button onclick="function1();">Replace text</button>
<div id="myDiv" style="width:300; height:200; border:solid black 1px;">Sample 
    <b id="myBold">text</b>
    
    
    
</div>
</body>
</html>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Node Operation
» replaceNode