Gets select the option selected value

Jquery always thought acquire select the option selected text value, it is written like this:

 $("#s").text();  //获取所有option的文本值

In fact, it should be this:

 $("#s option:selected").text();  //获取选中的option的文本值

Guess you like

Origin www.cnblogs.com/chen88/p/12222270.html