title: Setting className shortcut
body: <p>Is there a know one-liner for setting the <code>className</code> attribute in JavaScript? I mean where you don't have to worry if there is already some class(-es) defined or not.</p>
  
  <p>The shortest I could think of, is </p>
  
  <pre><code>var objDemo = document.getElementById("demo");
  objDemo.className = "newclass " + (objDemo.className || "");
  </code></pre>
  
  <p>This wouldn't die if the current <code>className</code> is undefined, however it leaves me with a trailing space. Would that be a problem for current browsers?</p>