Home › Forums › JavaScript › Random div inside random div function › Reply To: Random div inside random div function
January 15, 2018 at 5:13 pm
#265505
Shikkediel
Participant
This should do the trick:
var numItems = $('section'),
random = Math.floor(Math.random()*numItems.length)+1,
chance = Math.floor(Math.random()*numItems.eq(random-1).find('article').length);