Home  >  Article  >  Web Front-end  >  What does writeln mean in javascript

What does writeln mean in javascript

WBOY
WBOYOriginal
2022-01-12 16:34:522373browse

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,...)

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>

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

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

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!

Statement:
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