如何更改以下代码以隐藏页面加载内容。
<SCRIPT type=text/javascript>
for (var i= document.links.length; i-->0;) {
var link= document.links[i];
if (link.className=='showhide') {
var div= document.getElementById(link.hash.substring(1));
Toggler(link, div, true);
}
}
function Toggler(toggler, togglee, state) {
toggler.onclick= function() {
state= !state;
togglee.style.display= state? 'block' : 'none';
return false;
}
}
</SCRIPT>
答案 0 :(得分:0)
代码:
CSS:
#mango {display: none;}
HTML:
<body>
<div id="mango">
page content....
</div>
</body>
使用Javascript:
document.getElementById("mango").style.display = "block";
请参阅以下链接: