当第一个选择框更改但我不能更改第二个选择框的禁用样式时。请帮帮我。如何使用javascript更改选择框的禁用样式
<html>
<body>
<select onchange="a()" id="1">
<option>Choose</option>
<option>1</option>
<option>2</option>
</select>
<select id="2" disabled="true">
<option>one</option>
<option>two</option>
</select>
<script>
function a(){
if(document.getElementById('1').value!="Choose"){
document.getElementById('2').style.background="yellow";
document.getElementById('2').style.disabled="false";
}
}
</script>
</body>
</html>
@ Donte'Trumble你不应该需要这么简单的东西小提琴;) –
是啊,这就是为什么我删除了它。 ;) – dowomenfart