Guest User

Untitled

a guest
Jun 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. $(document).ready(function(){
  2. $("#clickMe").click(function(){
  3. $("#instructions").fadeToggle("slow");
  4. });
  5.  
  6. var firstNo, secondNo, answer, studentAnswer;
  7.  
  8. });
  9.  
  10. // Function JavaScript
  11. function generateQuestion()
  12. {
  13. // Declare Variables
  14. firstNo = (Math.floor(Math.random()*10));
  15. secondNo = (Math.floor(Math.random()*10));
  16.  
  17. answer = firstNo * secondNo;
  18.  
  19. document.getElementById("question").innerHTML = "Solve: " + firstNo + " x " + secondNo;
  20. $("#hidden").fadeIn("slow");
  21. }
  22.  
  23. function answerQuestion()
  24. {
  25. answer = document.getElementById("answer").value;
  26.  
  27. if (answer == (firstNo * secondNo))
  28. alert("You are correct");
  29. else
  30. alert("You are wrong");
  31. }
Add Comment
Please, Sign In to add comment