Replace select element for input text on option selection
How can I change a select list for an input text when a specific option is 开发者_如何学运维selected using jQuery?
<select onchange="if($(this).val()==2)$(this).replaceWith($('<input/>'))">
<option>1
<option>2
<option>2
</select>
精彩评论