»
S
I
D
E
B
A
R
«
Add CSS class with JavaScript
January 3rd, 2010 by admin

To add instead of replacing CSS class with JavaScript is easy.

Here is how you can add a CSS class:

document.getElementById("MyElement").className += " MyClass";
Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay



Similar Posts:
One Response  
  • Javascript Countdown Timer writes:
    January 9th, 2010 at 11:33 pm

    very basic tip for jQuery beginners

    [WORDPRESS HASHCASH] The poster sent us ‘0 which is not a hashcash value.


Leave a Reply

Powered by WP Hashcash

»  Substance: WordPress   »  Style: Ahren Ahimsa