dropinlist的selectedindexchanged事件不适用于jquery
你好,我有一个dropdownlist
。 我正在使用jquery插件为dropdownlist
提供样式。 jquery插件是jquery.dd.js 。 但我的问题是selectedindexchanged
事件在Internet exlorer 8中不起作用,虽然它在其他浏览器中工作正常。
试试这个:
$('#yourSelectId').change(function() { var selectedVal = $('#yourSelectId option:selected').attr('value'); });
你将获得selectedVal中的值
认为最好使用.val()
$('#yourSelectId').change(function() { var selectedVal = $('#yourSelectId').val(); });