Javascript Select All advice on altering the code

noobman

Regular Member
Joined
May 14, 2010
Messages
233
Reaction score
53
javascript:(function(){var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x.type == 'checkbox') {x.click();}}; alert('Done: fuck Facebook');})();

This code works for me at the moment, but you can tell that it would Select All Friends from the popup box. But, what code would I use if I only wanted to Select a certain range of checkboxes...say for example 51-100?

Can someone who knows what they are doing please alter this code to show an example of how to Select only a range?
 
Modify the for/next loop constraints. Make it for(var i = 51; i<=100; i++)

Code:
javascript:(function(){var  x=document.getElementsByTagName("input");for(var i=51;i<=100;i++)  {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done: fuck  Facebook');})();
 
Back
Top