62,268
社区成员
发帖
与我相关
我的任务
分享function Hide(obj)
{
var objContent=document .getElementById(obj);
if(objContent.style .display =="")
{
objContent .style.display="none";
}
else
{
objContent .style.display=""
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script>
function Hide(obj)
{
var objContent=obj;
if(objContent.style.display =="")
{
objContent.style.display="none";
b1.value="显示文字";
}
else
{
objContent.style.display="";
b1.value="隐藏文字";
}
}
</script>
</head>
<body>
<div id="divTt">是不是要这样调用呀</div>
<input id="b1" type=button value="隐藏文字" onclick=" Hide(divTt)" />
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script>
function Hide(obj)
{
var objContent=document.getElementById(obj);
if(objContent.style.display =="")
{
objContent.style.display="none";
b1.value="显示文字";
}
else
{
objContent.style.display="";
b1.value="隐藏文字";
}
}
function transfer(obj)
{
eval("Hide('"+obj+"')");
}
</script>
</head>
<body>
<div id="t1">是不是要这样调用呀</div>
<input id="b1" type=button value="隐藏文字" onclick="transfer('t1')" />
</body>
</html>
function allmbarShowHideDiv()
{
var divMusicLsts = document.getElementById("divnone");
if(divMusicLsts.style.display == "none")
{
divMusicLsts.style.display="block"
}
else
{
divMusicLsts.style.display="none"
}
}