How to add a class to a given element?

I have an element that already has a class:

<div class="someclass">
    <img ... id="image1" name="image1" />

Now, I want to create a JavaScript function that will add a class to the div (not replace, but add).

How can I do that?

85 thoughts on “How to add a class to a given element?”

  1. Pingback: viagra online
  2. Pingback: canada viagra
  3. Pingback: sildenafil online
  4. Pingback: viagra otc
  5. Pingback: herbal cialis
  6. Pingback: free cialis
  7. Pingback: cialis lilly
  8. Pingback: free viagra
  9. Pingback: sildenafil coupon
  10. Pingback: womens viagra
  11. Pingback: viagra price
  12. Pingback: viagra vs cialis
  13. Pingback: viagra generico
  14. Pingback: natural viagra
  15. Pingback: viagra cialis
  16. Pingback: viagra cost
  17. Pingback: hims sildenafil
  18. Pingback: sildenafil citrate
  19. Pingback: buy viagra

Leave a Comment