title: How can I use the same passValue function twice in Javascript?
body: <p>I want to pass the value of a input field in two spots. But my code only will pass it once. Is there a way to rewrite this to have it show up again down the code?</p>
  
  <pre><code>//HTML:
  &lt;input type="text" name="amount" onchange="passValue(this, 'preview_amount')"/&gt;
  
  //Outputs first value
  &lt;span id="preview_amount"&gt;&lt;/span&gt;
  
  //Outputs Nothing
  &lt;span id="preview_amount"&gt;&lt;/span&gt;
  
  //Javascript:
  function passValue(e, target){
      document.getElementById(target).innerHTML = e.value;
  } 
  </code></pre>