Menu Close

How to open a new html page on button click in javascript

codeamend

Learn the details about How to open a new html page on button click in javascript instantly right from your google search results with the Codeamend

Redirect new page when click the button using JavaScript

<button onclick="location.href='www.codeamend.com'">Click Me</button> 

OR

<button id="clickbtn" class="button">Move to Codeamend</button>

<script type="text/javascript">
    document.getElementById("clickbtn").onclick = function () {
        location.href = "www.codeamend.com";
    };
</script> 

Share

Posted in HTML, JavaScript

You can also read...

Leave a Reply

Your email address will not be published.