Simple method to toggle a give class on or off for the defined element.