Action on selected name fails.

Action on selected name fails.

I've got a simple select box with some names in my html form. I want to show a div when 'Tom' is selected in the select box, but somehow it doesn't seem to work. 

Please note that I want to check the names, not the select values.

  1. $(document).ready(function() {  
  2. $('#pgroup').change(function() {
  3.     if ($('#pgroup option:selected').text() === 'Tom') {
  4.         alert ("hi");
  5. $(".complete").show();
  6.     }
  7.     });
  8.  });

And my html:
  1. <select name="pgroup" style='width:150px;'>
  2. <option value=newboxes1>Jenny</option>
  3. <option value=newboxes2>Tom</option>
  4. </select>
  5. <div class="complete" name="complete" style="display:none;">hello</div>