感谢您的支持,我会继续努力的!
打开微信扫一扫,即可进行扫码打赏哦
点我查看本站打赏源码!
Powered by RUNCODEX.COM,学的不仅是技术,更是梦想!!!
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<p>JavaScript 能够直接写入 HTML 输出流中:</p>
<script>
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
</script>
<p>
您只能在 HTML 输出流中使用 <strong>document.write</strong>。
如果您在文档已加载后使用它(比如在函数中),会覆盖整个文档。
</p>
<button onclick="myFunction()">点击这里</button>
function myFunction()
{
document.write("调用了函数,文档被重写");
}
</body>
</html>
输入 JavaScript 代码……
xxxxxxxxxx
输入 CSS 代码……