For my question i'll need to first write some css.
.hide { display: none; }
Now, in jQuery which of the two examples below would be faster?
if ($('#a').is(':hidden')) {
$('#a').show();
} else {
$('#a').hide();
}
or
if ($('#a').hasClass('hide')) {
$('#a').removeClass('hide');
} else {
$('#a').addClass('hide');
}