Create event based on select in a selectlist

Create event based on select in a selectlist

Hi, I am trying to figure out a problem I have here.

When a user select something in a selectlist I want textfields to pop up beneath it. This is what I have for now:
<select id="edit-submitted-hur-manga-personer" class="form-select" name="submitted[hur_manga_personer]">
<option value="">Choose...</option>
<option value="1">1 Person</option>
<option value="2">2 Persons</option>
<option value="3">3 Persons</option>
<option value="4">4 Persons</option>
</select>


  1. $(document).ready(function(){
  2.   if ($("#edit-submitted-hur-manga-personer :selected").val() == 1) {
  3.     $("#webform-component-person_1").css("display", "block");
  4.   }
  5.  else $("#webform-component-person_1").css("display", "none");
  6.  });
I don't know if it is the value that's wrong, I don't know if you can do it like that.

The "#webform-component-person_1" is a fieldset containing some textfields.