javascript - css class toggle not toggling class -


I'm trying to toggle my class once click, but I'm having trouble doing this - If someone tells me what I'm missing or doing wrong, that would be great

  

javascript

  $ (document) .on ('click', '.addUsersToGroup', function (event) {$ ("AddUsersToGroup" $ (This)). ToggleClass ("icon-plus icon-minus");});  

You just have to use $ (this) as the time when You are seeing addUsertsToGroup

  $ (document) within the .addUsertsToGroup element. ('Click', '.addUsersToGroup', function (event) {$ (this) .toggleClass ("icon-plus icon-zero");});  

An example of working here


Comments