当选中某个选项时,我需要在选择选项中添加输入框。每当用户选择“其他”选项时,将出现一个输入框供用户输入数据。
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/