古詩詞大全網 - 成語經典 - optionvalue

optionvalue

在id="userType"的select上添加壹個onchange事件,即: <s:select id="userType" list="#{-1:'-請選擇-',2:'企業',1:'個人'}" onchange="changeUserType()"></s:select> function changeUserType(){ var _selected = jQuery("#userType").val(); var htmlTxt = "<option value='-1'>-請選擇-</option>"; if(_selected==2){ htmlTxt += "<option value='2'>-基本信息-</option>"; }else{ htmlTxt += "<option value='1'>-工作信息-</option>"; htmlTxt += "<option value='2'>-基本信息-</option>"; htmlTxt += "<option value='3'>-聯系信息-</option>"; } jQuery("#auditStatus").html(htmlTxt); }