Simple program to find number of vowels in a string not working
<p>I'm trying my hand on JavaScript and my browser refuses to execute this program I have written using switch case funtion. The goal is to find the number of vowels in a string (consider all are in-putted in lower case) </p>

<p>When I click the 'submit' button the text from the box goes away but nothing happens. 
The alert "hello" also does not appear, so I'm assuming that the function is not even being executed. </p>

<pre><code>   &lt;html&gt;
   &lt;head&gt;
   &lt;script&gt;
   function vow(form)
    {
     alert("hello");
     var a = new Array(10);
     a = form.t1.value;
     var flag = 0;
     var i;

     for(i=0;i&lt;10;i++)
       {
     switch (a[i])
      {
       case 'a':
       flag++;
       break;

       case 'e':
       flag++;
       break;

       case 'i';
       flag++;
       break;

       case 'o';
       flag++;
       break;

       case 'u';
       flag++;
       break;
      }
      }
  alert(flag);  
  }
  &lt;/script&gt;
  &lt;/head&gt;

  &lt;body&gt;
  &lt;form&gt;

  &lt;input type="text" name="t1"&gt;
  &lt;input type="submit" value="SUBMIT" onClick="vow(this.form)"/&gt;

  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
</code></pre>
