动态隐藏显示DIV
2009-03-03 10:05
323 查看
<html>
<head>
</head>
<body>
<script type="text/javascript">
function discontrol(itemid)
{
if(document.getElementById(itemid).style.display=='none')
{
document.getElementById(itemid).style.display="";
}
else
{
document.getElementById(itemid).style.display="none";
}
}
</script>
<a onclick="discontrol('test')" href="#">点击隐藏ID为test的DIV</a>
<div id="test" style="border: 1px solid rgb(238, 238, 238); padding: 5px; display:none">这是一段测试文字</div>
</body>
</html>
示例:
点击显示ID为test的DIV
这是一段测试文字
<head>
</head>
<body>
<script type="text/javascript">
function discontrol(itemid)
{
if(document.getElementById(itemid).style.display=='none')
{
document.getElementById(itemid).style.display="";
}
else
{
document.getElementById(itemid).style.display="none";
}
}
</script>
<a onclick="discontrol('test')" href="#">点击隐藏ID为test的DIV</a>
<div id="test" style="border: 1px solid rgb(238, 238, 238); padding: 5px; display:none">这是一段测试文字</div>
</body>
</html>
示例:
点击显示ID为test的DIV
这是一段测试文字
相关文章推荐
- JQuery动态隐藏和显示DIV
- JQuery Div的动态显示及动态隐藏
- 动态显示隐藏tbody/div
- JQuery动态显示和隐藏div
- jQuery动态显示和隐藏div
- 如何使用js动态显示或隐藏DIV
- JQuery动态隐藏和显示DIV
- div动态显示与隐藏时防止滚动条回滚
- 如何使用js动态显示或隐藏DIV
- js简单显示和隐藏div,触发超链接,动态更改button值,setInterval()简单使用,jquery easyui弹出框简单使用
- JQuery DIV 动态隐藏和显示的方法
- js动态创建div层,鼠标悬停显示隐藏div(无闪烁+小三角)
- img超出div width时, jQuery动态改变图片显示大小
- js控制 div显示隐藏
- 点击右键和按钮进行显示隐藏div
- android4.2 动态显示/隐藏导航栏
- js点击某个元素控制div显示,点击除div区域外任意处div隐藏
- Android应用——用LayoutTransition在View动态显示和隐藏时候加上动画
- js 控制div 显示隐藏的问题
- js控制div显示隐藏与赋值,selelect默认选中,div显示竖向进度条