当前位置:学会吧培训频道电脑知识学习网页制作Javascript教程JS、CSS 简单的控制层的现实与隐藏» 正文

JS、CSS 简单的控制层的现实与隐藏

[08-08 00:41:21]   来源:http://www.xuehuiba.com  Javascript教程   阅读:8565
概要:IT产品库 http://www.xuehuiba.com<!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> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>JS、CSS 简单的控制层的现实与隐藏—Y7L8’Blog</title> <style> body{margin:0 auto;text-align:center;paddi
JS、CSS 简单的控制层的现实与隐藏,标签:javascript视频教程,javascript教程下载,http://www.xuehuiba.com
IT产品库 http://www.xuehuiba.com<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>JS、CSS 简单的控制层的现实与隐藏—Y7L8’Blog</title>
<style>
body{margin:0 auto;text-align:center;padding-top:180px;}
div{width:100px;height:200px;background:#f00;margin:0 auto 10px;}
</style>
</head>
<body>
<div id="test" style="display:block">JS、CSS 简单的控制层的现实与隐藏—Y7L8’Blog</div>
<input type="button"  value="隐藏"; id="clickbutton">
<script type="text/javascript">
    var obj=document.getElementById("test");
    document.getElementById("clickbutton").onclick=function (){
        if(obj.style.display=="block"){
             obj.style.display="none";
             document.getElementById("clickbutton").value="显示";        }
       else{
           obj.style.display="block";
           document.getElementById("clickbutton").value="隐藏";       }
}
</script>
</body>
</html> IT产品库 http://www.xuehuiba.com
Tag:Javascript教程javascript视频教程,javascript教程下载电脑知识学习 - 网页制作 - Javascript教程
《JS、CSS 简单的控制层的现实与隐藏》相关文章
Copyright 学会吧 All Right Reserved.
在线学习社区!--学会吧
1 2 3 4 5 6 7 7 8 9 10 11 12 13