我可以使用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