+ 3
What is the different between \n and "<br/>"
5 Respuestas
+ 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 .....
+ 1
\n is a special character, br is html tag
+ 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
0
\n works in PHP, Js and C++
<br> in html
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.