Prev Demo
Returning 6 Lines Output In A Single Code By Using Javascript.
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <h1>6 Lines output with a single code.</h1> <p>Click the below button to get the 6 lines output.</p> <input type="button" value="Click" onclick="myLoops()" /> <p id="myId"></p> <script> function myLoops() { var a = ""; var i; for (i = 0; i < 6; i++){ a += "This is " + i + "<br/>"; } document.getElementById("myId").innerHTML=a; } </script> </body> </html>
Note: We DO NOT save your trial code in our database.
Output