清空select標(biāo)簽中option選項(xiàng)的3種不同方式

字號(hào):


    方法一
    代碼如下:
    document.getElementById("selectid").options.length = 0;
    方法二
    代碼如下:
    document.formName.selectName.options.length = 0;
    方法三
    代碼如下:
    document.getElementById("selectid").innerHTML = "";