A couple of questions about jQuery addClass()
Posted on 2015-01-16
I have two questions:
1) I have a <div> with child elements. When I do an addClass(".yellowBackground") to the <div>, all its children are getting it too. How can I prevent that from happening so that only the <div> gets the class?
2) Also, it seems like there is duplication happening at times where an element would have the same class added in twice. I'm not sure why that's happening because when I tested addClass(), adding an already existent class does not duplicate it. Any idea what might be causing this?