What does writeln mean in javascript

WBOY
Release: 2022-01-12 16:34:52
Original
2375 people have browsed it

In JavaScript, writeln means "newline output", which is used to write HTML expressions or JavaScript code to the document, and write a newline character after each expression, the syntax is "document.writeln (exp1,exp2,exp3,....)".

What does writeln mean in javascript

The operating environment of this tutorial: Windows 10 system, JavaScript version 1.8.5, Dell G3 computer.

What is the meaning of writeln in javascript

The write() method can write HTML expressions or JavaScript code to the document.

Multiple parameters (exp1, exp2, exp3,...) can be listed, and they will be appended to the document in order.

The writeln() method has the same effect as the write() method, except that a newline character can be written after each expression.

The syntax is as follows:

document.writeln(exp1,exp2,exp3,...)
Copy after login

exp1 represents the output stream to be written. They will be appended to the document in order.

The example is as follows:

<html>
<head>
<meta charset="utf-8">
<title>123</title>
</head>
<body>
<p>注意write()方法不会在每个语句后面新增一行:</p>
<pre class="brush:php;toolbar:false">
<script>
document.write("Hello World!");
document.write("Have a nice day!");
</script>
Copy after login

注意writeln()方法在每个语句后面新增一行:

<script>
document.writeln("Hello World!");
document.writeln("Have a nice day!");
</script>
Copy after login

Output result:

What does writeln mean in javascript

##[Related recommendations:

javascript learning tutorial

The above is the detailed content of What does writeln mean in javascript. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template