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


JAVASCRIPT DHTML TUTORIALS » Node Operation » addElement »

 

'addElement()' Example



    
<html>
<head>
<script language="JavaScript">
function function1() {
    myRange = document.body.createControlRange();
    myDiv = document.createElement('div');
    document.body.insertBefore(myDiv);
    myDiv.style.position = 'absolute';
    myDiv.innerText = 'New div element has been created';
    myRange.addElement(myDiv)

</script></head>
<body>
<input id="myB" 
       type="button" 
       value="Add element to the controlRange collection" 
       onclick="function1();">
</body>
</html>

    
      
      



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Node Operation
» addElement