title: Add a class (or attribute) if not already there
body: <p>How would I add an attribute to an element if that element does not already have that attribute?</p>
  
  <pre><code>if (' this does not have class=selected') {
  
      $(this).addClass('selected');
  }
  </code></pre>