我正在使用 jquery ui 从这个示例中创建我的选择选项菜单
在用户选择选项 1、选项 2 或选项 3 并且值完成输出/即一旦事件 ss 完成后,它应该改回“选择一个.. ”。
<script type="text/javascript">
$(function(){
// please note that option.event is always passed as a string, so do not test for true or 1 with if (options.value)
// see this issue for more information http://github.com/fnagel/jquery-ui/issues#issue/12
var speedD_first = $('select#speedD_first').selectmenu();
// alert(speedD_first[0]);
// var selVal=$('select#speedD_first').selectmenu("value");
//alert(selVal);
$('select').selectmenu({
change: function(e, object){
alert(object.value);
}
});
//$('select').show();
});
$(document).ready(function() {
$("select#speedD_first").change(function() {
var selVal=$("select#speedD_first").val();
// alert(selVal);
});
});
</script>
<fieldset>
<label for="speedD_first">Disabled and selected first option by HTML</label>
<select id="speedD_first">
<option disabled="disabled" selected="selected">Choose one...</option>
<option value="option1">Option 1</option>
<option value="option2">Option 2</option>
<option value="option3">Option 3</option>
<select>
</fieldset>