Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function(){
- $("#clickMe").click(function(){
- $("#instructions").fadeToggle("slow");
- });
- var firstNo, secondNo, answer, studentAnswer;
- });
- // Function JavaScript
- function generateQuestion()
- {
- // Declare Variables
- firstNo = (Math.floor(Math.random()*10));
- secondNo = (Math.floor(Math.random()*10));
- answer = firstNo * secondNo;
- document.getElementById("question").innerHTML = "Solve: " + firstNo + " x " + secondNo;
- $("#hidden").fadeIn("slow");
- }
- function answerQuestion()
- {
- answer = document.getElementById("answer").value;
- if (answer == (firstNo * secondNo))
- alert("You are correct");
- else
- alert("You are wrong");
- }
Add Comment
Please, Sign In to add comment