select去掉option選項 jQuery增加、刪除及修改selectoption的方法?
jQuery增加、刪除及修改selectoption的方法?js如何清除select中的值?idea:獲取select tag元素。選擇“選擇”下的選項。替換選項中的內(nèi)容,或刪除選項。代碼:<sc
jQuery增加、刪除及修改selectoption的方法?
js如何清除select中的值?
idea:獲取select tag元素。選擇“選擇”下的選項。替換選項中的內(nèi)容,或刪除選項。代碼:<script>window.onload=函數(shù)(){var oSel=文檔.getElementById(“sel”)var oOpt=新選項(“123”,“abc”)小孩兒(oopt)//添加一個OptionSel.removeChild選項(oopt)//刪除選項}</script></head><body><select id=“sel”>< option> 1234</選項></選擇>