Javascript examples for DOM HTML Element:Input Text
Change value of display:none input field
<html> <head> <title>Input Text To Dropdown Box</title> <script type="text/javascript"> function swap() {/* www. j av a 2 s. com*/ document.getElementById("contentswap").innerHTML = "<select><option value='cats'>Cats</option><option value='dogs'>Dogs</option></select>"; } </script> <style> #contentswap { display:inline; } </style> </head> <body <div id="contentswap"> <input type="text" name="original"> <br> <input type="button" value="Input To Select" onClick="swap()"> </body> </html>