title: get text from input and print it in a div in real time html
body: <p>i'm trying to get the text from an input in my html code and print the value of this input in a div and i want to do this in a real time so
  i tried with this javascript function</p>
  
  <pre><code>&lt;input id="fname" onkeyup="getVal()" type="text" name="filter_name" value="Nom" onclick="this.value = &amp;#39;&amp;#39;;" onkeydown="this.style.color = &amp;#39;#000000&amp;#39; " style="width:180px;" &gt;
  
  &lt;div id="icard" class="drag" style="left: 0px; top: 0px; width:10%;  height:10%;"&gt;  item&lt;/div&gt;
  </code></pre>
  
  <p>this is js function :</p>
  
  <pre><code>function getVal()
      {
      var x=document.getElementById("fname");
      x.value=x.value.toUpperCase();
      document.getElementById("icard").update("New text");
      document.getElementById("icard")=x;
      var s =document.getElementById("icard");
      s.value=x.value;
      }
  </code></pre>