1 | initial version |
There are several ways a button can be used to redirect when clicked:
<button onclick="window.location.href='http://www.example.com'">Click Here</button>
<button onclick="redirectTo('http://www.example.com')">Click Here</button>
<script> function redirectTo(url) { window.location.href = url; } </script>Regardless of the method you choose, it's important to make sure that the redirect is relevant to the user and that it doesn't negatively affect their user experience.