javascript控制div的显示与隐藏
分类: web application | 标签: div, javascript, 控制, 显示与隐藏 | 日期:2009-01-20
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “<a href=”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd” target=”_blank” rel=”external”>http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>”>
<html xmlns=”<a href=”http://www.w3.org/1999/xhtml” target=”_blank” rel=”external”>http://www.w3.org/1999/xhtml</a>”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″ />
<title>jexm’s blog</title>
<script language=”JavaScript” type=”text/JavaScript”>
<!–
function show(targetid){
if (document.getElementById){
target=document.getElementById(targetid);
if (target.style.display==”block”){
target.style.display=”none”;
newsInfo.style.height=”1528px”
} else {
target.style.display=”block”;
newsInfo.style.height=”1583px”
}
}
}
–>
</script>
<style type=”text/css”>
<!–
#test1{
display:none;
}
–>
</style>
</head>
<body>
<input name=”niming” type=”checkbox” onclick=”show(’test1′)” checked > 显示与否
<div id=”test1″><img src=”/logo.gif” border=”0″ align=”absmiddle” /></div>
</body>
</html>




















