If $(\'.my-element\') matches multiple element, is there a quick way to get a random element out of these?
$(\'.my-element\')
To get an even distribution, you can multiply random by the array count and drop the decimal with the bitwise operator.
var arr = ['a','b','c']; arr[~~(Math.random() * arr.length)]; //even odds of a, b, or c