+ 5
Is it possible to break JavaScript Code into several lines?
In output page without using html is it any way to achieve this..
14 Respuestas
+ 3
If you want to write in the dom then:
document.write("Helllo <br/> Next line <br/> 3rd line");
Br tag brakes line
+ 3
What use in console.?
+ 3
You can use it
document.write("Helllo <br/> World<br/> ");
Console.log() is mostly used debugging tool as i have seen on Google
+ 2
I want to break the line using only java script code..
+ 2
there is anyway to achive nextline in both console and browser
+ 1
I am willing to help you but for some reason I couldnt understand what result you want. It would be appreciated if you clarified the question.
+ 1
Yes, for dom use <br/> and for console is \n
0
A new line can be made using \n
0
To use in console you have to do:
console.log("helo \n second line \n 3rd line");
0
Are you using a script for your JavaScript?
0
Console.log (1, 2, 3, 4)
0
The best way is using ES6 template literals with `` backtipped string
document.write (`
Line1
Line2
Line3
....
${varname}
`);
on "console.log" too
You can also use variables inside ${varname}
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
0
Yes you can
- 1
Hi