You are currently checking if the index is equal to a random number. It might be better to create a random number for each input and check if it is more than 1 or less. So randomize the number between 0 and 2. something like:
jQuery.extend(jQuery.expr[":"], { random: function(a, i, m, r) { return Math.random() > 0.5; } }); alert( $("input:random").length );
In addition, if you get a support from an element, he will receive it only from the first.
source share