DOM Node JavaScript Tutorial

< html>
    
        insertBefore() Example
        
            function insertMessage() {
                var oNewP = document.createElement("p");
                var oText = document.createTextNode("www.rntsoft.com");
                oNewP.appendChild(oText);
                var beforeMe = document.getElementsByTagName("p")[0];
                document.body.insertBefore(oNewP, beforeMe);
            }
        
    
    
        

Hello World!