Answers for "html show text \n"

0

html text content new line

//setting this css style solving problem with new line in textContent
h1.setAttribute('style', 'white-space: pre;');

//add rn in text everywhere You want for line-break (new line)
h1.textContent = "this is line one  rn and this is line 2";
Posted by: Guest on September-22-2020
2

html put newline in text with n

white-space: pre-line;
Posted by: Guest on April-06-2020

Browse Popular Code Answers by Language