當第一個選擇框更改但我不能更改第二個選擇框的禁用樣式時。請幫幫我。如何使用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