title: How to add a class to a given element?
body: <p>I have an element that already has a class:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;someclass&quot;&gt;
      &lt;img ... id=&quot;image1&quot; name=&quot;image1&quot; /&gt;
  &lt;/div&gt;
  </code></pre>
  <p>Now, I want to create a JavaScript function that will add a class to the <code>div</code> (not replace, but add).</p>
  <p>How can I do that?</p>