javascript code to redirect to another page after hitting a button code example Example: javascript redirect window.location.href = "http://mywebsite.com/home.html";