In my attempt to divide a title into two lines, I fail in inserting therein a “carriage return” (or \r, or \n), to effectuate a two-line title.
I must add code before this line:
resultHdr = resultHdr + “Title B”;
I need to change the “resultHdr” earlier; It must already contain “Title A” - and a “carriage-return”, so that the line of code above would yield Title A and, on a next line, Title B.
It would seem absurdly simple to accomplish. But neither of these additions succeeded for me:?
resultHdr = "Title A” + "\n”;
resultHdr = “Title A \r”;
resultHdr = “Title A \n”;
resultHdr = resultHdr + document.createElement('br');
I fail in breaking the output line into two; It always shows up as “Title ATitle B” - all on the same line!
The program involves DOM scripting and here may lie the reason for my “faulty” rendering.
(There's a lot of stuff written on this, like typing in \\n or replacing with regular expressions, but they are years old and obviously things ain't still all that cut and dry). (Meanwhile - I'm stuck!)
`. The other question's accepted answer is specific to tooltips and won't work anywhere else. – Corey Ogburn Jul 06 '15 at 20:24