javascript onclick to redirect code example
Example 1: js onclick redirect
<button onclick="location.href='www.yoursite.com'">Click Me</button>
Example 2: js go to page
window.location.href = "http://example.com/new_url";
<button onclick="location.href='www.yoursite.com'">Click Me</button>
window.location.href = "http://example.com/new_url";