“Javascript Line Break” Kode Jawaban

Baris baru di JS

document.write("\n");
//second method for html page
document.write("<br>");
JavascriptNinja

Javascript Line Break

//in JavaScript, you can declare a line break (or new line)
//with the \n character.
var linebreak = '\n';
Dr. Hippo

Ganti jeda garis dengan html line break JS

let multilineString = `My
text\r1\r\n2\n3\n\r4
is
here`;

let htmlText = multilineString.replace(/(\r\n|\n\r|\r|\n)/g, '<br>');

console.log('Multiline string: ' + multilineString);
console.log('HTML text: ' + htmlText);
vmxes

JavaScript baris baru

console.log('Hello \n World');
Bored Beetle

Line Break di JS

<html>
   <body>
      <script>
         <!--
            document.write("Hello World!");
            document.write("<br>");
            document.write("Demo<br><br>Text!");
          //-->
      </script>
   </body>
</html>
Cloudy Cobra

Line Break di JS

var linebreak = '\n';
Wandering Warbler

Jawaban yang mirip dengan “Javascript Line Break”

Pertanyaan yang mirip dengan “Javascript Line Break”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya