当前位置:网站首页>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
边栏推荐
- C language - Growth Diary -02- function
- 如何做好空状态设计?来看这份全面总结
- Typescript keyboard mapping
- 代码设置ConstraintLayout的layout_constraintDimensionRatio
- Shell编程笔记
- TypeScript-类和接口、类和泛型、接口合并现象
- Database connection pool and bdutils tool
- C language - growth diary-04- preliminary exploration of local variables (local variables)
- Figure seamless database integration tushare interface
- C- print 99 multiplication table
猜你喜欢

Xshell7 and xftp7 to continue using this program, you must apply the latest updates or use a new version

Training yolov4 CSP model using coco dataset

About static keyword

Bubble sorting with C language

Space geometry

空间几何

Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)

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

【案例解读】医疗单据OCR识别助力健康险智能理赔

Bladed入門教程(視頻)
随机推荐
记一次忽略@SuppressLint(“NewApi“)提示引发的血案
嵌入式软件面试问题总结
2021-11-05 definition of cache
Tidb cloud launched Google cloud marketplace, empowering global developers with a new stack of real-time HTAP databases
用 Keras/TensorFlow 2.9 创建深度学习模型的方法总结
134. 加油站
Image processing operation record
C. Manipulating History(贪心/哈希/思维/好题)
Return in foreach and break in for
如何做好空状态设计?来看这份全面总结
Logical implication of functional dependence
TypeScript-null和undefined
空间几何
TypeScript-类型别名
Figure seamless database integration tushare interface
A detailed explanation of one of the causes of dead loop caused by array out of bounds in C language
运筹学导论
通过ComponentCallbacks2来接收onTrimMemory等回调,并mock对应的场景
TypeScript-类型保护
Tidb Cloud est en ligne sur le marché Google Cloud pour permettre aux développeurs du monde entier d'utiliser une nouvelle pile de bases de données htap en temps réel