Demo of ToggleClass Behavior

ToggleClass on Click

When the mouse is clicked on the avatar then toggle the style class back and forth between the 'selected' and 'not-selected' style classes. The effect is to turn a selection border on/off on each click.

$proto('#avatar', {
  Click: {
    onClick: {
      ToggleClass: {
        styleClass: 'selected',
        otherStyleClass: 'not-selected'
      }
    }  
  }
});

For a full description of this behavior see the ToggleClass Documentation Page.