Simple JavaScript search box

后端 未结 3 576
遇见更好的自我
遇见更好的自我 2021-02-10 14:30

I tried connecting the first text box, so it would turn it into a URL, and then when \'search\' is clicked, it would jump to that website, not sure if it\'s impossible, or i\'m

3条回答
  •  遇见更好的自我
    2021-02-10 15:17

    Here's how I would do it:

     
     
    

    Of course you could do this:

     
    
     onclick="func();"
    

    Or document.getElementById("search-button").onclick = function(){ window.location = document.getElementById('link-box').value;
    };

    Or last of all

     
    

提交回复
热议问题