I am administrator of an event and would like to invite the members of one "friend list" to this event. In the "Invite Friends" dialog I selected the list (using the dropdown menu), so that it only shows members of this list.

invite friends

Now is there a way to select everybody displayed?

Do I have to select them one-by-one?

I saw some invite-all-friends JavaScript code, but will this select only people in the selected friend list?

I don't want to invite the others.

1 Answer 1


The code you mentioned does not work as Facebook UI has changed and it will continue to change. Nevertheless,

javascript:var x=document.getElementsByTagName("input");for(var i=0;i<x.length;i++) {if (x[i].type == 'checkbox') {x[i].click();}}; alert('Done, all your friends have been selected');

Source: http://olivo.net/2011/04/how-to-invite-all-your-facebook-friends-to-an-event-at-once-code-has-changed/

Should do the trick. It works on the currently selected list. The above should not break in any future builds though as the only input elements on the page are your Facebook friends.

  • This code needs to be pasted in the browser's URL bar after having the list open in the invitation dialog. If the list is long, scroll to the bottom of it, so that all elements get loaded. Does not work in Firefox but works in Chrome (Chrome removes the javascript: part automatically so you will have to retype it).
    – nic
    Feb 11, 2013 at 15:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.