我在jquery网格中有三列,这三列都有下拉列表框。
如果您选择第一个下拉列表框,我需要启用第二个值。如果选择second,我需要使用jquery启用第三个。
发布于 2010-04-08 05:59:36
关于jquery,最酷的事情之一是它能够处理DOM中的事件。
您要查找的事件是.change() http://api.jquery.com/change/
2个select元素的html标记
<select id="first_select">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<select id="second_select" disabled="disabled">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>javascript/jquery处理对选择框的更改
$("#first_select").change(function() {
$("#second_select").removeAttr('disabled');
});当对第一个选择元素进行更改时,将启用第二个选择元素。对于第三个select,请遵循此逻辑。
https://stackoverflow.com/questions/2596142
复制相似问题