JavaScript document.writeln line break
JavaScript document.writeln is a similar function of document.write . It uses " line " as the output mode. If you want to output multi-line strings through document.write , you need to add some HTML line break tags. Please refer to " JavaScript document.write line break ". In fact , the document.writeln function of JavaScript itself can perform the effect of multi-line output, but simply use document.writeln to output. In the environment of many browsers, it cannot produce multi-line effects. It must be matched with the <pre> tag. effective.
JavaScript document.writeln basic syntax
document.writeln("The string content to be displayed on each line");
Please put the content of the string to be displayed in each line in the parentheses of document.writeln, and then write the output content of document.writeln in the second line... and so on, write document.writeln in a new line in the code, The effect will be displayed line by line on the web page, which is very different from the effect of document.write without line division.
JavaScript document.writeln example
<script>
document.writeln("Welcome to Jasonseo.");
document.writeln("Have a good time.");
</script>
</pre>
<script>
document.writeln("Welcome to Jasonseo.");
document.writeln("Have a good time.");
</script>
Have a good time.
Welcome to Jasonseo. Have a good time.
Post a Comment
0 Comments