jQuery Show a Textbox When an Option is Selected

Posted by Cameron on Stack Overflow See other posts from Stack Overflow or by Cameron
Published on 2010-03-24T11:34:42Z Indexed on 2010/03/24 11:43 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

I have the following code:

<select>
<option value="Type 1">Type 1</option>
<option value="Type 2">Type 2</option>
<option value="Type 3">Type 3</option>
<option value="Other">Other</option>
</select>

<input type="text" id="other" />

What I want to do is using jQuery make the textbox below hidden by default, and then show it if a user selects the other option from the dropdown.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript