JavaScript

How to redirect page on button click event in JavaScript?

Redirect to new page on button on click in JavaScript. Make an HTML button redirect me to another page. Just add an onclick event to the button.

HTML

<button type="button" class="btn" onclick="location.href = 'www.yoursite.com';">About Us</button>

How can I make a button redirect my page to another page?

How to redirect page on button click event in JavaScript?
How to redirect page on button click event in JavaScript?

You can customize this code further as per your requirement.


Learn HTML/CSS from W3 School Website