<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><title>Writing to Same Doc</title>
<script language="JavaScript">
function reWrite(){
// assemble content for new window
var newContent = "<html><head><title>A New Doc</title></head>"
newContent += "<body bgcolor='aqua'><h1>This document is brand new.</h1>"
newContent += "Click the Back button to see original document."
newContent += "</body></html>"
// write HTML to new window document
document.write(newContent)
document.close() // close layout stream
}
function Write(){
// assemble content for new window
var Content = "<html><head><title>A New Doc</title></head>"
Content += "<body bgcolor='aqua'><h1>This document is brand new1.</h1>"
Content += "Click the Back button to see original document."
Content += "</body></html>"
// write HTML to new window document
douument.write(Content)
//document.close() // close layout stream
}
</script>
</head>
<body>
<form>
<input type="button" value="Replace Content" onClick="reWrite()">
<input type="button" value="Replace" onClick="Write()">
</form>
</body>
</html>
douument.write(Content)
docu===》douu
document.write(Content)