Home > Blockchain >  Unable to split a string into a new line
Unable to split a string into a new line

Time:02-18

There is so much documentation and I've looked at dozens of articles. I don't know what I am doing wrong, but essentially what I am trying to do is show text in a span with multi lines:

Span:

 <span style="color:red" id="errors"></span>


 var errText = "<b>NOTE:</b>  There are "   "<b>"   errors.length   "</b>"   “ issues that must be addressed. Please make changes as necessary.";

Goal is to make this text look like this:

 NOTE: There are 3 issues that must be addressed.
 Please make changes as necessary.

I've trying using , I've tried \n but nothing seems to work.

Ex 1:

var errText ="<b>NOTE:</b>  There are "   "<b>"   errors.length   "</b>"   “ issues that must be addressed.\n Please make changes as necessary.";

Ex 2:

var errText ="<b>NOTE:</b>  There are "   "<b>"   errors.length   "</b>"   “ issues that must be addressed.\ 
 Please make changes as necessary.";

WHat am i doing wrong?

CodePudding user response:

<span>NOTE: There are 3 issues that must be addressed. <br> Please make changes as necessary</span>

  • Related