【发布时间】:2014-02-23 11:03:51
【问题描述】:
我需要在选择选项时添加输入。每当用户选择“其他”时,都会有一个输入框供用户输入数据。
HTML:
<select>
<option>Choose Your Name</option>
<option>Frank</option>
<option>George</option>
<option>Other</option>
</select>
<!-- when other is selected add input
<label>Enter your Name
<input></input>
</label> -->
我的 jsfiddle:http://jsfiddle.net/rynslmns/CxhGG/1/
【问题讨论】:
-
您需要使用 javascript 或 jQuery - 从这里开始:api.jquery.com/change
标签: javascript jquery html select input