title: addClass and className does not work in js
body: <p><code>hr1</code> is the id of a line which dynamically created using JavaScript.  Then I tried to set the color of its <code>bottom border</code>.  When I run the code, I find that version 1 works but version2, version 3, version 4 and version 5 doesn't work.  Hope someone could help me point out why this happens. Thank you in advance. </p>
  
  <p>Version 1:</p>
  
  <pre><code>$('#hr' + 1).css("border-bottom-color", "red");
  </code></pre>
  
  <p>version 2:</p>
  
  <pre><code>js:
  $('#hr' + 1).addClass('thing');
  
  css:
  .thing {
      border-bottom-color: red;
  }
  </code></pre>
  
  <p>version 3:</p>
  
  <pre><code>js:
  $('#hr' + 1).className = "thing";
  
  css:
  .thing {
      border-bottom-color: red;
  }
  </code></pre>
  
  <p>version 4:</p>
  
  <pre><code>js:
  $('#hr' + 1).attr('class', "thing");
  
  css:
  .thing {
      border-bottom-color: red;
  }
  </code></pre>
  
  <p>version 5:</p>
  
  <pre><code>js:
  $('#hr' + 1).setAttribute('class', "thing");
  
  css:
  .thing {
      border-bottom-color: red;
  }
  </code></pre>