当前位置:网站首页>JS learning basics document Write write a line of text in the page

JS learning basics document Write write a line of text in the page

2022-06-11 08:10:00 .---

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>05.24 Rookie tutorial 2 Demo</title>
</head>
<body>

<h1> My first one  Web  page </h1>
<p> My first paragraph .</p>

<script> document.write(Date()); document.write(" Ha ha ha ha ha ha ha "); </script>

</body>
</html>

It works like this  Insert picture description here

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>05.24 Rookie tutorial 2 Demo</title>
</head>
<body>

<h1> My first one  Web  page </h1>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<p> My first paragraph .</p>
<script> document.write(Date()); document.write(" Ha ha ha ha ha ha ha "); </script>

</body>
</html>

If we change it to this way, we will find that the words "ha ha ha" do not break lines document.write Adding text or something should not be a block level element
document.write If it is written in a function and called, it will cover the entire page !!!
 Insert picture description here
Self study for beginners Js

原网站

版权声明
本文为[.---]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206110803561682.html