【问题标题】:Replace select element for input text on option selection替换选项选择时输入文本的选择元素
【发布时间】:2011-09-09 07:14:49
【问题描述】:

当使用 jQuery 选择特定选项时,如何更改输入文本的选择列表?

【问题讨论】:

标签: jquery list select text input


【解决方案1】:
<select onchange="if($(this).val()==2)$(this).replaceWith($('<input/>'))">
  <option>1
  <option>2
  <option>2
</select>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-06-29
    • 1970-01-01
    • 1970-01-01
    • 2019-02-13
    • 2021-09-02
    • 2011-09-18
    • 2020-12-06
    相关资源
    最近更新 更多