Menu Close

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

0
(0)

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> 

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

Share

Posted in HTML, JavaScript

Leave a Reply

Your email address will not be published. Required fields are marked *

You can also read...