下拉框取值判断状态

window.onload = function () {
    document.getElementById('Select1').onclick = function () {
        var index = document.getElementById('Select1').selectedIndex;
        var a = document.getElementById('Text1');
        a.setAttribute('value', document.getElementById('Select1').options[index].value);
        var b = document.getElementById('span2');
        b.innerText = document.getElementById('Select1').options[index].value;
    }
};

原文地址:https://www.cnblogs.com/handsomer/p/3678266.html