HTML tags are not case sensitive: <P> means the same as <p>
始终为属性值加引号
属性值应该始终被包括在引号内。双引号是最常用的,不过使用单引号也没有问题。
在某些个别的情况下,比如属性值本身就含有双引号,那么您必须使用单引号,例如:
name='Bill "HelloWorld" Gates' 外部脚本不能包含 <script> 标签请使用 document.write() 仅仅向文档输出写内容。
如果在文档已完成加载后执行 document.write,整个 HTML 页面将被覆盖:
实例
<!DOCTYPE html> <html> <body> <h1>My First Web Page</h1> <p>My First Paragraph.</p> <button οnclick="myFunction()">点击这里</button> <script> function myFunction() { document.write("糟糕!文档消失了。"); } </script> </body> </html> JavaScript 对大小写是敏感的。下面的代码创建名为 cars 的数组:
var cars=new Array(); cars[0]="Audi"; cars[1]="BMW"; cars[2]="Volvo";或者 (condensed