0
JavaScript and HTML.
How can i create a JavaScript button in HTML that takes me to another page/section?
2 odpowiedzi
+ 3
Just add an onclick event to the button:
But you shouldn't really have it inline like that, instead, put it in a JS block and give the button an ID:
<button id="myButton" class="float-left submit-button" >Home</button>
<script type="text/javascript">
document.getElementById("myButton").onclick = function () {
location.href = "www.yoursite.com";
};
</script>
0
Kambiz thank you so much!!