If $(\'.my-element\') matches multiple element, is there a quick way to get a random element out of these?
$(\'.my-element\')
$.fn.random = function() { return this.eq(Math.floor(Math.random() * this.length)); } $(selector).random();