title: DHTML - Change text on page using input field
body: <p>I need to create a code to change an example text to a user-defined value when the user types in an input field (Similar to the preview field when writing a question on Stack Overflow).</p>
  
  <p>This needs to be achieved without the use of HTML5 or Flash as the users will be running IE8, not all will have Flash plug-ins installed.</p>
  
  <p>As such I have started by looking at DHTML to achieve the desired effect. Currently I can change the example text when a user types in the input field but only to a pre-defined value ("Example" in the code below), how should I edit this code to display the user-defined value?</p>
  
  <p>JS</p>
  
  <pre><code>    function changetext(id)
  {
  id.innerHTML="Example";
  }
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code>&lt;form&gt;
  Content:&lt;input type="text" id="input" onkeyup="changetext(preview)" /&gt;  
  &lt;/form&gt;
  
  &lt;p id="preview"&gt;No content found&lt;/p&gt; 
  </code></pre>