On a button click? I would suggest
HTML:
<input type = "button" onclick = "openpage()" value = "open page">
JavaScript:
function openpage()
{
window.location.assign("http://www.yoursite.com/main.html");
}
But why not just use a link?
<a href = "https://stackoverflow.com/questions/16855551/main.html">Main page</a>
Your question was hard to understand. I think this is what you want.
3
solved how to open an html page using html5 [closed]