What is the different between \n and "<br/>" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

What is the different between \n and "<br/>"

14th May 2017, 2:20 PM
Dicky Arya Kesuma
Dicky Arya Kesuma - avatar
5 Answers
+ 5
>>> the basic difference between them is..... \n is use in c++ whereas <br/> is use in html ......however they both do they same work .....
14th May 2017, 4:31 PM
#Happy@777
#Happy@777 - avatar
+ 1
\n is a special character, br is html tag
14th May 2017, 2:31 PM
mike
+ 1
/n is used inside a String and it means end of line FYI: https://en.wikipedia.org/wiki/Newline <br> This will show up as a new line when HTML is rendered in a browser. FYI: https://www.w3schools.com/tags/tag_br.asp
16th May 2017, 12:13 AM
Jorge Daniel Lopez Irusta
Jorge Daniel Lopez Irusta - avatar
0
\n works in PHP, Js and C++ <br> in html
14th May 2017, 5:35 PM
StoffelJs
0
To elaborate on the above in how they are applied specifically in Javascript, \n will be useful in your code which just utilizes JavaScript and the console. Whereas <br/> will be useful when you are calling upon the DOM to write Javascript mixed with HTML.
15th May 2017, 2:00 AM
Matt
Matt - avatar