skip to Main Content

Html – How to change href using javascript function?

I have a button, that when a user clicks on it, The page will be redirected to another link. Index.html: <input type="text" placeholder="Search" id="input-box" autocomplete="off" style="width: 250px;"> <button id="submitbtn" onClick="submitClicked" href=""> </button> </input> Script.js: document.getElementById("submitbtn").onclick = function() {submitBtn()}; function submitBtn()…

VIEW QUESTION
Back To Top
Search