difference between toggleclass and addclass
问题 I am working with jquery and attempting to add a class to a table on the selection of that table row. I was initially using the following code - $(this).parents("tr").toggleClass("over", this.clicked); For some reason, that wasn't working in only some instances where there was already a class assigned. Before I went too crazy with any troubleshooting, I changed it to the following - $(this).parents("tr").addClass("over", this.clicked); This new option appears to be working fine. My question