|
Jsp page drop-down list:
Select time period:
< Select name = "timespan" id = "timespan" class = "Wdate">
< Option value = "1"> 8: 00-8: 30 < / option>
< Option value = "2"> 8: 30-9: 00 < / option>
< Option value = "3"> 9: 00-9: 30 < / option>
< / Select> When you select the last value, the need to obtain a value corresponding to the selected text and values.
jQuery get value drop-down list to select the code and text:
var obj = $ ( "# timespan option: selected");
var artime_val = obj.val ();
var artime_text = obj.text ();
alert ( "val:" + artime_val + "text" + artime_text); // val: 3 text 9: 00-9: 30 |
|
|
|