Does it have to open in the sam
Eg:
input type="button" onclick="write()" value="Click"
Does it have to open in the sam
Eg:
input type="button" onclick="write()" value="Click"
No, it doesn't always have to open in a new window.
Now, if you'll be a lot more specific I can give you a better answer.
document.write statements must be run before the page finishes loading
EDIT: Therefore, you wouldn't want to put document.write into an onclick
If you're trying to modify a page already loaded you'll have to use div tags and use something like:
document.getElementById("name").innerHTML = "bob";