这是我定制的DropDownList的代码:
<script type="text/javascript">
$(document).ready(function () {
var source = [ "Alappuzha","Eranakulam","Idukki" ];
// Create a DropDownList
$("#Widget").jqxDropDownList({autoOpen: true, source: source, selectedIndex: 1, width: '241', height: '30'});
});
</script>
<div id='Widget' >
</div>
如何使用javascript从上面的列表框中获取所选索引值?
答案 0 :(得分:2)
您可以使用jqxDropDownList小部件的API:
var selectedIndex = $('#Widget').jqxDropDownList('selectedIndex');