Home > Web Front-end > JS Tutorial > Implementing ninety-nine multiplication tables based on javascript_javascript skills

Implementing ninety-nine multiplication tables based on javascript_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 15:08:05
Original
1206 people have browsed it

The example in this article shares with you the relevant code for implementing the ninety-nine multiplication table in JavaScript. The specific content is as follows

<script type="text/javascript">
    var sum=0;
    var wite;
    for (var i = 1; i < 10; i++){
      var div=$('<div class="class'+i+'"></div>');
      $("body").append(div);
      for(var j = i; j > 0; j--){
        sum = j * i;
        wite = (j+"X"+i+"="+sum);

        div.prepend($('<span style="padding-right:10px">'+wite+'</span>'));
      }
      
    } 
  </script>

Copy after login

The implementation result is shown in the figure:

I hope this article will be helpful to everyone learning JavaScript programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template