I want to display a different form for different selections of this drop down list:
<label>
<select name="type" id="type">
<option value="object" selected="selected">Object</option>
<option value="number">Number</option>
<option value="text">Text</option>
<option value="date">Date</option>
<option value="time">Time</option>
<option value="geo">Geospatial</option>
<option value="currency">Currency</option>
</select>
</label>
What would be the jQuery event that is triggered when a user selects one of these options. Would the .click() event be triggered in this case as well?
You should use the
changeevent. Click will be triggered on every mouse click, which is not what you want, and it’ll be triggered even if the user clicks on the combo but doesn’t change the value.Also,
clickwon’t be good for keyboard navigation, sochangeis the way to go: