Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>Using a for loop javascript</title>
- </head>
- <body>
- <h1>for Loop Example</h1>
- <p>the following is the output of the <b>for</b> loop</p>
- <button onclick=”myfunction()”>Click to try</button>
- <p id=”demo”></p>
- <script>
- function myfunction() {
- var i='15';
- for(i=0; i<10; i++;) {
- x = x + “The number is” + i + “</br>”;
- }
- document.getElementById(“demo”).innerHTML= x;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement