how to change css class name using javascript

Most of the programmers don’t know about how to change css class name using javascript, specially beginners.Its very easy to change css style using javascript on any event .You just have to make a javascript function with one line and call that function on any event like onLoad , onclick etc.

suppose you want to chane css of a div when click on a button or any link.A simple div which has some text and on click on a button you want to change the border color and background color of that div.To do this first make your css class in your .css file .

Read the rest of this entry »