日期:2014-05-16 浏览次数:20347 次
$('#disser').live('click',function(){
var code=$('#districtCode').val().trim();
$("tr[id=disTR]").hide();
$("td[id^="+code+"]").parents("#disTR").show();
});
<table cellspacing="0" border="0" cellpadding="0" width="100%">
<tr class="bottom_bg"><td> </td>
<td> </td></tr>
<tr>
<td class="left_menu_bg02">
<div style="width: 340px; height: 150px; margin-top: 0px; overflow: auto;"
class="left_menu_bg2" id="menuList">
<table width="100%" class="listStyle" id="distable">
<tr><th width="40px"> </td>
<th width="70px">地区代码</td>
<th>地区名称</td></tr>
<c:forEach items="${dis}" var="dis">
<tr id="disTR"><td><input type="checkbox"/></td>
<td id="${dis.districtCode}">${dis.districtCode}</td>
<td id="${dis.districtFullName}">${dis.districtFullName}</td></tr>
</c:forEach>
</table>
</div>
</td>
<td>
<table>
<tr>
<td align="right">地区代码:</td><td align="left"><input class="input_M3" id="districtCode" type="text"/></td>
</tr>
<tr>
<td align="right">地区名称:</td><td align="left"><input class="input_M3" id="districtFullName" type="text"/></td>
</tr>
<tr><td> </td></tr>
<tr>
<td></td>
<td align="right">
<input name="" id="disser" type="button" class="button_blue" value="查 询" />
</td>
<tr>
</table>
</td>
<tr class="bottom_bg">
<td ></td>
<td align="right">
<input name="" id="disadd" type="button" class="button_blue" value="保 存" />
<input name="" id="disnot" type="button" class="button_blue" value="取 消" />
</td>
</tr>
</table>
$('#disser').click(function(){
var code = $('#districtCode').val().trim();
$("#distable tr").hide();
$("#distable tr[id^='" + code + "']").show();
});