Javascript Document.open() Method
Javascript Document.open() Definition and Usage
The open() method opens a document for writing.
If a document exists in the target it will be cleared. If this method has no arguments, a new window with about:blank is displayed.
Syntax
| document.open("mimetype"[,replace]) |
Example
<html>
<head>
<script>
function createNewDoc()
{
var newDoc=document.open("text/html","replace")
var txt="<html><body>Learning about the DOM is FUN!</body></html>"
newDoc.write(txt) newDoc.close()
}
</script>
</head>
<body>
<input type="button" value="Open and write to a new document" onclick="createNewDoc()">
</body>
</html> |
|