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?
- `$('#dialog').classToggle('bounce')`
- `$('#dialog.bounce').removeClass().addClass()`
- `$('#dialog').addOrRemoveClass('bounce')`
- `$('#dialog').toggleClass('bounce')`
Answer: The correct answer of the above question is Option D:`$('#dialog').toggleClass('bounce')`