Q:

Looping through an array and setting variables

What I have so far:
http://codepen.io/anon/pen/umHzl?editors=101
You notice that you can click a box and unclick it. What I would like is that when a certain button is clicked all other buttons are unclicked(turn back to normal color).
My attempt at this:
        for (var i =0; i < booths.length; i++){
                var obj = booths[i]
                obj.e1['fill'] = obj['color'];
                obj.e1['checked'] = 'false';
                $("#"+obj.name).remove();
            }

I know that the color is in the e1/rectangle object of the box, but I do not know how to change/access that variable. It says obj.e1 is undefined. If I do obj['fill'] it still doesn't work.
How would I change the colors from such a loop (or something similar).

A:

It's not e1, it's el (lowercase 'L'). And you'll still want to use the attr() function, e.g.:
for (var i =0; i < booths.length; i++){
  var obj = booths[i]
  obj.el.attr('fill', obj['color']);
  obj.el.attr('checked', 'false');
  $("#"+obj.name).remove();
}

Example: http://codepen.io/paulroub/pen/yFwCq

