Jquery add class to multiple elements. addClass() method manipulated the className property of the selected elements, not the class attribute. Currently it adds a class only to the last one. Jan 31, 2013 · I'm using this bit of javascript to add a class to multiple elements. attr() method to get the value of an element's attribute has two main benefits: Convenience: It can be called directly on a jQuery object and chained to other jQuery methods It simply adds the class, appending it to any which may already be assigned to the elements. Tip: To add more than one class, separate the class names with spaces. A function returning one or more space-separated class names or an array of class names to be added to the existing class name (s). The . @bazzlebrush your selector would capture elements with . The addClass() Method Here's how to use the addClass . Sep 15, 2015 · Basically I like to add a new class to multiple elements with the same class name. qsfa yohyf xdcekf sfozrh zykexc sjppef rbf coava yhmprgb cuj