currentArticle and nextArticle formatting question


Hi there isn't any error with my codes, however, I'm wondering why there is no need to write $('.currentArticle') instead of 'currentArticle' , is the reason cause of the fact that currentArticle is a variable?

var main= function() {
    $('.article').click(function() {

  $(document).keypress(function(event) {
    if(event.which === 111) {
  else if(event.which === 110) {
  var currentArticle = '.current';
  var nextArticle = '';


The correct format of writing currentArticle was supposed to be currentArticle.removeClass('current'). I wrote the wrong one in my first post to show what I thought was correct.


Hey @seanhoon,

I think I've answered a similar question before. Does this post answer your question: