- <html>
- <style type="text/css">
- a {
- display: none;
- }
- </style>
- <body>
- <p id="p"> a paragraph </p>
- <a href="http://www.google.com" id="a">google</a>
- </body>
- <script type="text/javascript">
- var a = (document.getElementById('a')).style;
- alert(a.display);
- var p = (document.getElementById('p')).style;
- alert(p.display);
- p.display = 'none';
- alert(p.display);
- </script>
- </html>
第一个和第二个警报只显示一个空字符串,我认为应该没有和阻止.
然而,在强烈的显示设置之后,第三个警报最终没有提示.
谢谢.