+ 1

How do i get the appended text in the new line?

\n just add a space and using <br /> is not working. Please help. https://code.sololearn.com/WzP44Ik3rJYu/?ref=app

2nd Jan 2019, 12:21 PM
Ritik Pal
Ritik Pal - avatar
2 Answers
+ 5
...... var node1 = document.createTextNode("This is new"); p.appendChild(node1); p.appendChild(document.createElement('BR')); ......
2nd Jan 2019, 12:25 PM
KrOW
KrOW - avatar
0
DOM.innerText += "\n Your content" ;
2nd Jan 2019, 4:26 PM
Gordon
Gordon - avatar