Question: Though jQuery offers visual effects, it is considered a best practice to use CSS to set up different states triggered by classes, where it makes sense. What's the easiest way to enable and disable a class bounce on an element with the ID dialog?

  1. `$('#dialog').classToggle('bounce')`
  2. `$('#dialog.bounce').removeClass().addClass()`
  3. `$('#dialog').addOrRemoveClass('bounce')`
  4. `$('#dialog').toggleClass('bounce')`

Answer: The correct answer of the above question is Option D:`$('#dialog').toggleClass('bounce')`