如何使用JavaScript用JavaScript替换文档的内容?
您可以尝试运行以下代码,以了解如何使用JavaScript替换JavaScript中的文档内容-
示例
<!DOCTYPE html>
<html>
<body>
<p>Click and replace this content.</p>
<button onclick = "Display()">Replace</button>
<script>
function Display() {
document.open("text/html","replace");
document.write("<p>Demo text!</p>");
document.close();
}
</script>
</body>
</html>热门推荐
10 侄儿生日祝福语简短独特
11 二胎祝福语简短霸气
12 喜庆节的祝福语简短
13 圣诞简短祝福语给父母
14 关于扬州的祝福语简短
15 老公生日祝福语简短好看
16 工人生日祝福语简短
17 周二祝福语大全简短
18 婚礼亲友祝福语简短幽默