1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript Select All advice on altering the code

Discussion in 'FaceBook' started by noobman, Aug 26, 2011.

  1. noobman

    noobman Regular Member

    Joined:
    May 14, 2010
    Messages:
    215
    Likes Received:
    30
    Gender:
    Male
    Occupation:
    Growth Hacker/Developer
    Home Page:
    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?
     
  2. Crazy

    Crazy Jr. Executive VIP

    Joined:
    Jun 13, 2009
    Messages:
    640
    Likes Received:
    319
    Occupation:
    VB, C#, XHTML, CSS, PHP, MySQL, JavaScript, jQuery
    Location:
    Everywhere
    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');})();
     
    • Thanks Thanks x 1