Display The Output In The Border Using Functions - Javascript DOM

Javascript examples for DOM:Document write

Description

Display The Output In The Border Using Functions

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Table-2</title> 
   </head> 
   <body onload="myFunction()"> 
      <script>
        function myFunction() {//w ww .  j av a 2 s.  c  o m
            var num = 2;
            for (var i = 1; i < 11; i++) {
                document.write(num + " * " + i + " = " + num * i);
                document.write('<br>');
            }
        }
    
      </script>  
   </body>
</html>

Related Tutorials