7

So another infamous code (or smart code) you decide, there's class 'error' in the template/html and here this genius is removing it and adding it back? is this even logical at any level,

I mean just hide() and show() would do the job

Comments
  • 2
    I'm more annoyed by the repetitive, expensive lookups
  • 4
    $(this).removeClass(‘error’).addClass(‘error’).show(); 😞

    Although why are we adding and removing the same class??
  • 2
    @C0D4 My first thought was to reset the visibility of the error element but don’t see why logically.
  • 1
    why jquery in the first place? Why JS?
  • 0
    Perharps ".error" contains an animation, and this guy is triggering it (just guessing)
  • 0
Add Comment