Sunday, January 2, 2011

Set Class From Javascript


//change the tab class style
var browser=navigator.appName;
var classtyp;
if(browser=='Microsoft Internet Explorer')
{
classtyp = "className";
}
else
{
classtyp = "class";
}

if (val=='new')
{
document.getElementById("liUpcoming").setAttribute(classtyp, "selectednews");
document.getElementById("liPast").setAttribute(classtyp, "");
}

No comments:

Post a Comment