Advertisement
SSYT

Random Question

May 31st, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function() {
  2.     var possible = [
  3.         "Intrebarea 1",
  4.         "Intrebarea 2",
  5.         "Intrebarea 3",
  6.         "Intrebarea 4",
  7.         "Intrebarea 5",
  8.         "Intrebarea 6",
  9.         "Intrebarea 7"
  10.     ];
  11.    
  12.     $(".buton").on("click", function(e) {
  13.         e.preventDefault();
  14.         var text = Math.floor(Math.random() * possible.length);
  15.         document.getElementById('result').innerHTML = possible[text];
  16.     });
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement