JAVASCRIPT Can you help me make two dice roll at the same time?
-
I need to make two dice roll at the same time in this javascript file. But when I create a second die, and click roll the button, only the first die will roll. I need both of them to roll simultaneously. What should I do to my code for it to work?? Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"> <title>Rolling A Die in JavaScript</title> <style type="text/css"> #dice { font-family: Symbola, Code2000, DejaVu Sans, Droid Sans Fallback, EversonMono, STIXGeneral, Quivira, Unicode BMP Fallback SIL ; line-height: 2em; font-size: 300%; } form { background: transparent; border: none; } </style> </head> <body> <h1>Rolling A Die in JavaScript</h1> <p>You need a font containing Unicode dice characters to see this demonstration as intended.</p> <h2>The demo</h2> <form action="" onsubmit="start();return false"> <div><input type="submit" value="Roll"></div> <div><span id="dice">⚀</span><span id="dice">⚀</span></div> </form> <script type="text/javascript"> function roll() { document.getElementById('dice').innerH... = String.fromCharCode(0x2680+Math.floor(... String.fromCharCode(0x2680+Math.floor(... } var countdown_number; function go() { if(countdown_number > 0) { countdown_number--; roll(); if(countdown_number > 0) { countdown = setTimeout('go()', 100); } } } function start() { countdown_number = 10; go(); } </script> </body> </html>
-
Answer:
You need to sort out your variables first.
R33sez-P!3sez at Yahoo! Answers Visit the source
Other answers
You need to sort out your variables first.
Related Q & A:
- Can a MongoDB key have two arrays?Best solution by Stack Overflow
- Can you have more than two majors?Best solution by Yahoo! Answers
- How to make two pictures one?Best solution by Yahoo! Answers
- Make two of yourself in a video?Best solution by wiki.answers.com
- Can anyone help me make poems? please?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.