Posts

Showing posts from April, 2018

jQuery add or remove class

Image
hasClass Returns true if an element has the specified class otherwise false addClass Adds one or more specified classes. To add multiple classes separate them with a space. removeClass Removes one or multiple or all classes. To remove multiple classes separate them with a space. To remove all classes, don't specify any class name. toggleClass Toggles one or more specified classes. If the element has the specified class then it is removed, if the class is not present then it is added. < html > < head >      < title ></ title >      < script   src ="jquery-1.11.2.js"></ script >      < style >          .boldClass  {              font-weight :  bold ;          }         ...