Hiding page elements based on form "select"

Hiding page elements based on form "select"

Lets say I have a select in a form...
  1. <select name="selector" id="selector">
  2. <option value="1">Option 1</option>
  3. <option value="2">Option  2</option>
  4. <option value="3">Option  3</option>
  5. </select>
I want to show and hide some table rows based on the option selected so that the following table...
  1. <tr id="row1">Some Content</tr>
  2. <tr id="row2">Some Content</tr>
  3. <tr id="row3">Some Content</tr>
will only show the row corresponding to the selected option.

I know I can use $("# selector").val() to get the value of the select box but I'm not sure how to use that value to do anything useful...
    • Topic Participants

    • james