/// <summary> /// Add or remove one or more classes to the element, depending on either the class's presence. /// </summary> public static HElement ToggleClass(this HElement element, String[] className) { if (element != null && className != null) { foreach (var cName in className) { if (element.HasClass(cName)) { element.RemoveClass(cName); } else { element.AddClass(cName); } } } return(element); }