Change value of display:none input field - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Input Text


Change value of display:none input field

Demo Code

ResultView the demo in separate window

      <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>";


#contentswap {

   <body <div id="contentswap"> 
      <input type="text" name="original">  
      <input type="button" value="Input To Select" onClick="swap()">  

Related Tutorials