title: onchange() on dropdown not calling the function
body: <p>Below is my HTML code:</p>
  
  <p>I want the script to run when an option is selected. I think the code I have written in correct. 
  console.log() is not printing anything on the console so this means the function is not invoked. 
  Can anybody help me? This is very basic code but I don't know whats wrong in it.</p>
  
  <pre><code>&lt;div class="form-group required"&gt;
      &lt;label for="InputLastName"&gt;For how many hours ? &lt;sup&gt;*&lt;/sup&gt; &lt;/label&gt;
      &lt;select name="serviceHours" id="hours" onchange="getHours(this.value)"&gt;
      &lt;option value="" selected&gt;---------&lt;/option&gt;
      &lt;option value="1"&gt;1 Hour&lt;/option&gt;
      &lt;option value="2"&gt;2 Hours&lt;/option&gt;
      &lt;option value="3"&gt;3 Hours&lt;/option&gt;
      &lt;option value="4"&gt;4 Hours&lt;/option&gt;
      &lt;option value="5"&gt;5 Hours&lt;/option&gt;
      &lt;option value="6"&gt;6 Hours&lt;/option&gt;
      &lt;option value="7"&gt;7 Hours&lt;/option&gt;
      &lt;option value="8"&gt;8 Hours&lt;/option&gt;
      &lt;option value="9"&gt;9 Hours&lt;/option&gt;
      &lt;option value="10"&gt;10 Hours&lt;/option&gt;
      &lt;option value="11"&gt;11 Hours&lt;/option&gt;
      &lt;option value="12"&gt;12 Hours&lt;/option&gt;
      &lt;/select&gt;
      &lt;script type="text/javascript"&gt;
          function getHours(value){
              var hours = value;
              console.log(hours+ " hello");
          }
      &lt;/script&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>If I change the function name the console is not giving an error undefined functions or function not found .</p>
  
  <p>if I replace onchange="getHours(this.value)" with onchange="alert(this.value);" it is not working then also.</p>
  
  <p>Can anyone tell the jquery way of doing this ??</p>