document.write实现在网页中输出内容。
有以下四种使用形式:
1.document.write("Hello World");
2.var str="Hello World";
document.write(str);
3.document.write("Hello "+"World");
4.输出html标签
document.write("hello"+"<br>"+"world");
本文详细介绍了document.write在网页开发中的四种使用形式:直接输出字符串、通过变量输出、字符串连接输出以及输出HTML标签。重点阐述了每种形式的应用场景及注意事项。
document.write实现在网页中输出内容。
有以下四种使用形式:
1.document.write("Hello World");
2.var str="Hello World";
document.write(str);
3.document.write("Hello "+"World");
4.输出html标签
document.write("hello"+"<br>"+"world");
1万+
3237

被折叠的 条评论
为什么被折叠?