The O Shortcut


Can somebody please show me in what lesson did it show how to add a class or remove a class????? I have not seen it, so I'm having an issue with the code on this current exercise.

var main = function() {
$('.article').keypress(function(event) {
if(event.which === 111){



Hi Antimatter,

You can use the jQuery function addClass() to add a class, removeClass() to remove one, and toggleClass() to toggle a class. Pretty simple :wink:
Their usage is like this:

          /* ↑ `addClass()` and `removeClass()` work the same way */

The o shortcut, step 7

thank you very much.