我可以使用jquery显示带有以下代码的链接标签的表格。单击按钮的隐藏表
$(document).ready(function()
{
$("#show").click(function()
{
$("#table").show();
});
});
但是当我想为一个按钮,为此,它会显示表第二那么它会被隐藏。这些按钮的代码:
$(document).ready(function()
{
$("#button").click(function()
{
$("#table").show();
});
});
更新:
$(document).ready(function()
{
$("#table").hide();
$("#button").click(function()
{
$("#table").show();
});
});
下面是代码:
<script type="text/javascript" src="jquery-1.8.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#table").hide();
$("#button").click(function()
{
$("#table").show();
});
});
</script>
</head>
<body>
<p><a href="#" id="show">Show</a> <a href="#" id="hide">Hide</a></p>
<form id="form1" name="form1" method="post" action="">
<p>
<input type="submit" name="button" id="button" value="Show" />
</p>
<p> </p>
</form>
<table width="515" border="0" class="table1" id="table">
<tr>
<td width="509" class="table1"><img src="Image/Tulips.jpg" width="400" height="400" alt="Tulips" /></td>
</tr>
</table>
请演示,例如http://jsfiddle.net。 –
适用于我: http://jsfiddle.net/hmartiro/RMxq4/ –
发表了更多你的代码,还有一些事情是你没有给我们看的 – aquinas