- Forget about
document.write
. If you wanted to add a link element to a web page (not needed here), you could try usingdocument.createElement
anddocument.body.appendChild
. - If you want to navigate to an URL through Javascript, you can assign to
window.location
. - Instead of a button, maybe you can make a normal link in the first place?
0
solved How to open a local html file from html page?