jq
function changeStreet(a){ var valk=$(a).html(); $(a).parents(".select_box").children(".select_choose").children(".hadSelect").text(valk); $(a).parents("ul.select_ul").hide(); $(a).parents(".select_box").children(".select_text").val(valk); } <p class="pOut choice"> <label><b>房型</b>:</label> <span class="fangxing" id="fx1">普通住宅</span><span class="fangxing" id="fx2">复式</span><span class="fangxing" id="fx3">LOFT</span><span class="fangxing" id="fx4">跃式</span><span class="fangxing" id="fx5">单间</span> <input type="hidden" class="select_text" name="hm" value=""/> <em class="errorChoice"></em> <b class="sum"></b> </p>