当前位置:网站首页>Js学习基础document.write在页面中写一行文字
Js学习基础document.write在页面中写一行文字
2022-06-11 08:04:00 【.---】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>05.24菜鸟教程第二个Demo</title>
</head>
<body>
<h1>我的第一个 Web 页面</h1>
<p>我的第一个段落。</p>
<script> document.write(Date()); document.write("哈哈哈哈哈"); </script>
</body>
</html>
运行出来是这个样子的
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>05.24菜鸟教程第二个Demo</title>
</head>
<body>
<h1>我的第一个 Web 页面</h1>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<p>我的第一个段落。</p>
<script> document.write(Date()); document.write("哈哈哈哈哈"); </script>
</body>
</html>
如果我们改成这个样子的话发现哈哈哈哈这几个字没有换行呢document.write加入文字或者什么东西应该不属于块级元素
document.write如果写在了函数中去调用他会覆盖整个页面!!!
初学者初学者自学Js
边栏推荐
猜你喜欢

(transformation) tree, binary tree and forest transformation principle

Printing diamond of beginner C

Black Qunhui dsm7.0.1 physical machine installation tutorial
![[the most complete ENSP [installation diagram] in history!]](/img/1a/7d50d6e5c06a5e3ce6acab16ddb638.jpg)
[the most complete ENSP [installation diagram] in history!]

Method summary of creating deep learning model with keras/tensorflow 2.9

Tutoriel de démarrage bladed (vidéo)

学习《缠解论语》

Storage of floating point in memory

Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np

Detailed explanation of shift operator and bit operator in C language
随机推荐
Return in foreach and break in for
Collation of basic knowledge of intermediate development of Andrews (for interview)
TypeScript-类和接口、类和泛型、接口合并现象
Bladed入门教程(视频)
Selenium click the floating menu and realize the functions of right mouse button
Scrape captures 51job Recruitment Information (static page)
multi-sig SC
TypeScript-枚举
C language - Growth Diary -02- function
How to output the percent sign "%" in printf function in C language
Several ways to avoid concurrent modification exceptions of lists
Introduction to operations research
TypeScript-类型保护
Training yolov4 CSP model using coco dataset
Image processing operation record
TiDB Cloud 上线 Google Cloud Marketplace,以全新一栈式实时 HTAP 数据库赋能全球开发者
DAMENG 用户管理
学习《缠解论语》
Simple use of string
(transformation) tree, binary tree and forest transformation principle