The f.toggleClass method is not only slow but also buggy/misbehaving.
http://jsperf.com/tt-js-add-class/15 will show you it's speed vs the others, also if you look it exibits odd behavour and doesn't actually toggle when there is more than 1 element being targeted. Targeting a single element to toggle the class seems to work OK though. The behaviour of .addClass is similar and works weird with multiple targets just as toggleClass behaves.
The f.toggleClass method is not only slow but also buggy/misbehaving. http://jsperf.com/tt-js-add-class/15 will show you it's speed vs the others, also if you look it exibits odd behavour and doesn't actually toggle when there is more than 1 element being targeted. Targeting a single element to toggle the class seems to work OK though. The behaviour of .addClass is similar and works weird with multiple targets just as toggleClass behaves.