我尝试使用jquery隐藏并显示html内部表。我希望在页面加载后隐藏表格,然后在点击搜索按钮后,表格将显示值。
但下面的代码是隐藏的,在点击搜索按钮后,它会闪烁并再次隐藏。请告诉我这里有什么问题。
$(document).ready(function() {
$("#historylist").hide();
$("#historysearch").click(function() {
$("#historylist").show();
});
// }
});
<table id="searchTbl" width="800" >
<tr>
<td valign="top">Release No</td>
<td valign="top">
<input type="text" name="releaseNo" value="" style="width:200" />
</td>
<td valign="top"><input type="button" value="Search" onClick="commit()" style="width:80" id="historysearch"/></td>
</tr>
<br /><br />
<table border="1" cellpadding="2" cellspacing="0" id="historylist">
<tr>
<th><font size="-1">Header1</font></th>
<th><font size="-1">Header2</font></th>
<th><font size="-1">Header3</font></th>
<th><font size="-1">Header4</font></th>
<th><font size="-1">Header5</font></th>
</tr>
</table>
</table>
function commit(){
document.menu.cmd.value='search';
document.menu.submit();
}
答案 0 :(得分:0)
你能试试吗,
function commit(){
$("#historylist").toggle();
}