var allSelect = document.getElementsByTagName("select");
for (var i=0; i<allSelect.length; i++)
{
if (allSelect[i].style.backgroundColor.toUpperCase() == "#C0C0C0")
{
allSelect[i].disabled = true;
}
}没测,试试看!
for (var i=0; i<allSelect.length; i++)
{
if (allSelect[i].style.backgroundColor.toUpperCase() == "#C0C0C0")
{
allSelect[i].disabled = true;
}
}没测,试试看!
for (var i=0; i<a.length; i++)
a[i].disabled=a[i].style.backgroundColor.toUpperCase()=="#C0C0C0"?true:false;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
用background
html的就是background-Color
<option>a</option>
<option>b</option>
<option>c</option>
</select>
<script type="text/javascript">
//<![CDATA[
alert(sel.currentStyle['backgroundColor'])
for (var i in sel.currentStyle)
document.write(i+":"+sel.currentStyle[i]+"<br/>")
//]]>
</script>