Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function buttonGenerator(){
- var allAnswers = [21],
- randomizer = [];
- // Generates 3 random answers
- for(a = 0 ; a < 3; a++) {
- wrongAnswers = Math.floor((Math.random() * 100) + 1);
- allAnswers.push(wrongAnswers);
- }
- // Generates random buttons while inputting the correct and incorrect answers randomly
- for(i = 0 ; i < 4; i++) {
- var buttonArea = $("#answerOptions");
- input = $('<button class="col-xs-6 btn btn-primary"></button>');
- input.appendTo(buttonArea);
- }
- shuffle(allAnswers);
- console.log(allAnswers);
- }
- buttonGenerator();
Add Comment
Please, Sign In to add comment