Bug Tracker


Ticket #6140 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

jQuery removeClass bug?

Reported by: Leur Owned by:
Priority: Milestone: 1.4.2
Component: unfiled Version: 1.4.1
Keywords: Cc:
Blocking: Blocked by:


In this example I try removing the class of bake and adding the class of cake. However when cake is added, $(".bake") takes the action of what should have been just $("cake").

var bake=0; $(document).ready(function() { $(".bake").click(function() { $(this).html("Clicks: " + ++bake); $(this).removeClass('bake'); $(this).addClass('cake'); }); });

Change History

comment:1 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to invalid

Do you have a larger example? I'm not seeing the issue here.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.


Add a comment

Modify Ticket

as closed

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.