JSFiddle - React, Tailwind, and code Playground

Randomly select from 3 categories to produce one ultra hard mode

by Koding Kamp

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

  Click button below to randomly choose 3 catergories for FRIDAY HARD MODE!!
<p />

  <button onclick="randomizeSelection()">
  Randomize!
  </button>

JavaScript

var category1 = ["Environmental", "Character", "Blah Blah Blah", "Mecha", "Creature"];

var category2 = ["Anime", "Painterly", "Black and White", "Limited Pallet"];

var category3 = ["Time Constrant", "Left Hand Only", "Blind Folded", "Inverted"];

function randomizeSelection(){



	var selection1 = category1[Math.floor(Math.random() * category1.length)];
  var selection2 = category2[Math.floor(Math.random() * category2.length)];
  var selection3 = category3[Math.floor(Math.random() * category3.length)];
  
  var hardModeSelection = "Type: " +selection1+ ".<br>Style: " +selection2+ "<br>Debuff: " +selection3+ "!!!";
  
  $("#display").html(hardModeSelection);
}