点击一下这个,,功能怎么实现

有一个checkbox和一个表格,

如果我点一下一checkbox,表格就出现
再点一下,,表格就消失,,,
应该怎么做?
---------------------------------------------------------------

1<input onclick="setVT(this.checked)" type="checkbox"/>
1<div id="tt" style="">
2<table>   
3...   
4</table></div>

function setVT(v)
{if (v==true)
tt.style.display='';
else
tt.style.display='none';
}

---------------------------------------------------------------

表格的样式中无法自动隐藏的, 最好用div
---------------------------------------------------------------

最好用DIV

Published At
Categories with Web编程
comments powered by Disqus