HTML DOM display 属性
2016-03-14 23:20
399 查看
定义和用法
display 属性设置元素如何显示。语法:
Object.style.display=value
可能的值
实例
本例设置不显示元素:<html> <head> <script type="text/javascript"> function removeElement() { document.getElementById("p1").style.display="none"; } </script> </head> <body> <h1>Hello</h1> <p id="p1">This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.</p> <input type="button" onclick="removeElement()" value="Do not display paragraph" /> </body> </html>
相关文章推荐
- MVC采用HtmlHelper扩展和Filter封装验证码的功能
- html表单
- HTML学习有感
- 将.md转化为.html
- 关于 客户端发现响应内容类型为“text/html; charset=utf-8”,但应为“text/xml”的解决方法
- 1、HTML基础总结 part-1
- 缓冲运动-1-[解决1].html
- html网页上按钮交替切换bottom shift代码
- HTML基础篇--html标签
- Freemarker输出$和html标签等特殊符号
- Html解析
- html语义化
- 防止XSS攻击的方法-使用白名单过滤html标签
- html入门的笔记总结
- 3.14 HTML中获取当前项目路径
- HTML网页超链接title赋一个变量
- W3C Blog: HTML-下一步是什么?
- 为什么直接访问项目名与加上index.html看到的页面不一样
- HTML 特殊符号编码对照表
- HTML笔记一