javascript - open the value of an input field in new tab. I would like to change the value of the input field in real time -


i have input field , button. input field has value @ load time, change value after page loads , on button click use value url in new tab. new javascript input helpful. in advance.

<table width="100%" border="0" cellspacing="0" cellpadding="0">   <tr>     <td>     <input type="text" id="box" value="http://google.com" width="100%" /> </td>     <td>     <button id="newtab1" value = "search" style="position: absolute;">new tab</button>     </td>   </tr> </table> 

add onclick property button.

<button id="newtab1" value = "search" style="position: absolute;" onclick="myfunction();">new tab</button> 

then have function process input

<script> function myfunction(){     var url = document.getelementbyid('box').value     window.open(url); }    </script> 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -