Prev Demo
JavaScript
>
Breaking Long Code Lines
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>Line breaking strings</h1> <div id="myId"></div> <script> var a = "The Most popular website for learning the technology is:" document.getElementById("myId").innerHTML = a + "<br/>"+ "TechFunda.Com"; </script> <br /> <div id="Id"></div> <script> var b = "The Most popular website for learning the technology is: "; document.getElementById("Id").innerHTML = b + "<br/>" + "Tech\Funda\.Com"; </script> <br /> <div id="Div"></div> <script> var c = "The Most popular website for learning the technology is:"; document.getElementById("Div").innerHTML = c + "<br/>" + "TechFunda" + ".Com"; </script> <p><strong>Note:</strong> Observe the code in the code box carefully, to know how to break a line in different ways.</p> </body> </html>
Note: We DO NOT save your trial code in our database.
Output