title: Passing function into javascript constructor
body: <p>Trying to get a variable from a  HTML input field and pass it as parameter on a javascript constructor. I'm new to JS</p>
  
  <p>Constructor</p>
  
  <pre><code>function Stopwatch(elem,count_Up,count_Down) {
  
    //Private Variables
    var time = 0; // Time in milliseconds
    var interval; // Used for update function
    var offset;   // 
    var countUp = count_Up
    var countDown = count_Down
    console.log('SWT'+countUp+count_Up)
  </code></pre>
  
  <p>Adding Values to constructor</p>
  
  <pre><code>function setCountTarget()
  {
   var countTarget_Up = document.getElementById("count_Target").value;
   return countTarget_Up;
  
  }
  
  var watch = new Stopwatch(timer,setCountTarget(),setCountTarget()); 
  //Create Stopwatch object 1
  </code></pre>