get current text <select>

后端 未结 2 1954
你的背包
你的背包 2021-01-23 02:11
                 

相关标签:
2条回答
  • 2021-01-23 02:40

    You don't need the semi colon after the html() function and val does not return the html which is what your looking for.

    alert($("#<%=sctFieldMain.ClientID %> option:selected").html());
    

    However if you had the following and wanted the value "Example" then you should use val()

    <option value="example">some test</option>
    
    0 讨论(0)
  • 2021-01-23 03:00

    Use

    alert($("#<%=sctFieldMain.ClientID %> option:selected").html());
    

    EDITED

    Also your question duplicates this one and this.

    0 讨论(0)
提交回复
热议问题