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