0
我将颜色更改为背景颜色,现在JavaScript停止工作,如何修复它?JavaScript更改脚本
<script type="text/javascript">
var mySelect = document.getElementById('my-select');
document.getElementById('my-select').value='<?php echo $ats; ?>';
var setBgColor = function (select) {
select.style.background-color = select.options[select.selectedIndex].style.background-color;
};
mySelect.onchange = function() {
setBgColor(this);
document.searchform.submit();
};
if(-1 != mySelect.selectedIndex) {
setBgColor(mySelect);
}
</script>
谢谢队友! Rly thnx! – Sidas
我们都是初学者(我很深)。 – reg4in