title: How to specify onchange function that is defined within another function?
body: <p>I have a form with multiple values. When a value is selected/changed, it needs to get passed into a function. This function is however, defined inside another function (and it would be nice to keep it that way). The function in mind also has multiple parameters.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;select onChange="selectValue(this.value, x, y)"&gt;
  &lt;option value="Value 1"&gt; Value 1 &lt;/option&gt;
  </code></pre>
  
  <p><strong>JS</strong></p>
  
  <pre><code>function FunctionOne()
  {
    this.selectValue = function(value, x, y) { /* do something */ }
  }
  </code></pre>
  
  <p>So I would call this function elsewhere like this:</p>
  
  <pre><code>A = new FunctionOne();
  
  A.selectValue(value, 1, 2) // where value is specified from an instance of my data (irrelevant to the problme I'm having)
  </code></pre>
  
  <p>This way the <code>onchange</code> function is not found, and ideally I do not want to have it defined outside the other function. Also I am not sure how to handle the multiple inputs that <code>selectValue</code> has, in the HTML code.</p>