title: Converting a textbox into any other html element
body: <pre><code>&lt;form name="txt" method="post"&gt;
  
  &lt;input type="text" name="select" id="select" onclick="return selectbox();"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Now through js or html can I change my textbox into a select or a list box. Is it possible by any way.</p>
  
  <p>//js code</p>
  
  <pre><code>function selectbox()
  {
  var select=document.getElementById('select');
  select.innerHTML="&lt;select&gt;&lt;option&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;&lt;/select&gt;";
  }
  </code></pre>
  
  <p>Something like this should happen. In the place of the textbox the below code should appear
  //new textbox</p>
  
  <pre><code>&lt;select&gt;&lt;option&gt;1&lt;/option&gt;&lt;option&gt;2&lt;/option&gt;&lt;/select&gt;
  </code></pre>