Native javascript code to implement the jiugongge lottery Effect

Source: Internet
Author: User
This article mainly introduces the sample code for native JS to achieve the 9-palace lattice lottery effect. It has good reference value. Next, let's take a look at it. This article mainly introduces the Code for the implementation of the native javascript code for the jiugongge lottery. It has good reference value. Let's take a look at it with the small Editor.

:

 
  
   

  • First prize
  • Second prize
  • Third prize
  • 4th Prize
  • Start
  • Fifth Prize
  • Sixth Prize
  • 7th Prize
  • 8th Prize

Script var container = document. getElementById ('Container'), li = iner. getElementsByTagName ('lil'), aa = container. getElementsByTagName ('A') [0], pp = document. getElementById ('pp '), timer = null; function start () {var I = 0; var num = Math. floor (Math. random () * li. length) + 20; if (I ';} Else {pp. innerHTML + = "Congratulations, you have received:" + parseInt (num % li. length) + "" +'
';}}, 130) ;}} aa. onclick = function () {start ();} script

The above is the detailed content of the Code for implementing the jiugongge Lucky Draw using native javascript. For more information, see other related articles in the first PHP community!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.