if we want to change the class name from "abc" to "xyz" of a div tag having attribute id="a" through javascript and these classes are defined in stylesheet then following is the javascript code.
javascript code:
function ChangeClass(id,class)
{
document.getElementById(id).className=class;
}
ChangeClass('a','xyz');
No comments:
Post a Comment