ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
~~~ <div class="m-select2"> <p class="m-input">请选择校区</p> <select name="" id=""> <option value="">请选择校区</option> <option value="">请选择校区2</option> <option value="">请选择校区3</option> <option value="">请选择校区4</option> </select> </div> ~~~ ~~~ // 模拟下拉菜单 $(".m-select2").each(function(){ var _val = $(this).children("select").children("option:selected"); if( _val.trim() != "" ){ $(this).children("selectText").text( _val ); } } ) $(".m-select2 select").on("change",function(){ // var _seText = $(this).children("input[type=text]"); var _seleP = $(this).parents(".m-select2"); var _seleVal = $(this).val(); var _seleText = $(this).children("option:selected").text(); _seleP.children(".m-input").text( _seleText ).attr("value",_seleVal); }); ~~~