My arrays:
var mexicanFood = ["Taco Bell", "Beans", "Taco Time", "Buritos", "Chalupa"];
var asianFood = ["Noodles", "Rice", "Sushi", "Fish", "Chicken"];
var americanFood = ["Hot dogs", "Pizza", "Burgers", "Nachos", "Other"];
Know this is a possibility to grab randomly from array:
var randomIndex = Math.floor(Math.random() * mexicanFood.length);
I want to pull a value from each food category. I don't want all of mexicanFood values to be the result for food options. I want it at random but at least to pull one or two from each category. How can you do that with having it go into radio buttons (maybe 5 radio buttons) and can it be done with Math.random?
Also want it to be in javascript and html if possible
Edit:
I basically want different food categories in arrays. Then have random values pulled from the categories and those values will be put into radio buttons. My overall project that I want to create is a voting poll for restaurants to eat at. So I don't want 5 burger places to come up when I have mexican, asian, american, and other options to randomly pull from.
What I am stuck on is how to randomly pull from each array. I know how to randomly pull from one array list. But when I have mexicanFood, asianFood and americanFood (or even more than those), I am not sure how to randomly pull values from those and have those values populate radio buttons
{ name: 'Taco Bell', type: 'mexican' }. Using the single array makes your life easier and you can still distinguish which foods are of which type.