Advertisement
Guest User

Untitled

a guest
Oct 20th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var arr = ["a1","a2","a3","a4","a5","a6"];
  2. var correctResult = [];
  3. //function ()
  4. var rand = Math.floor(arr.length * Math.random());
  5. var currentShow = arr[rand];
  6. correctResult.push(currentShow)
  7. document.getElementById(currentShow).style.backgroundColor = "yellow";
  8. arr.splice(rand, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement