Using document.write() on the Current Window : Document : Development JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Development » Document »

 

Using document.write() on the Current Window



<HTML>
<HEAD>

<SCRIPT LANGUAGE="JavaScript">
function reWrite() {
    var newContent = "<HTML><HEAD><TITLE>A New Doc</TITLE></HEAD>"
    newContent += "<BODY><H1>This document is brand new.</H1>"
    newContent += "Click the Back button to see original document."
    newContent += "</BODY></HTML>";

    document.write(newContent);
    document.close();
}
</SCRIPT>
</HEAD>
<BODY>
<FORM>
<INPUT TYPE="button" VALUE="Replace Content" onClick="reWrite()">
</FORM>
</BODY>
</HTML>



           
       



-

Leave a Comment / Note


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

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Development
» Document