title: Add only if div doesn't have class on it
body: <p>My problem is that I want score to be added only when the user clicks the <code>div</code> and the <code>div</code> doesn't have class <code>selected</code> or <code>wrong</code> on it. In simpler words, if class already exists on the <code>div</code>, I don't want the score to be added. Right now it works fine but it keeps adding score if the user keeps clicking on the same <code>div</code>.</p>
  
  <p>Sorry for the incomplete code(this is part of pretty long jQuery game) but any guidance will be helpful!</p>
  
  <p><strong>JQuery</strong></p>
  
  <pre><code>if ($(this).attr("selected") == "selected") {
      $(this).addClass("selected");
      var score = parseInt($("#score").html());
      score += 20;
      $("#score").html(score);
  } else {
      $(this).addClass("wrong");
      var score = parseInt($("#score").html());
      score -= 10;
      $("#score").html(score);
  }
  </code></pre>