I am trying to redirect to a link when the button is clicked, but it is not working, please need a working code, please.
function myFunction() {
document.getElementById("mycom").location.href = "http://mywebsite.com/home.html"";
}
<button type="button" onclick="myFunction()">Try it</button>