Using javascript to change CSS?

Is it possible to use js to change css? What I’m trying to do is pretty simple, I have a timer with a start and a stop button, and would like to set certain intervals where the css will automatically change the background-color css property. For example at 60 seconds change to one green, at 120 seconds change to orange, etc…

Here’s my existing code.

<html>
<head>
<script type=“text/javascript”>
var c=0;
var t;
var timer_is_on=0;

function timedCount()
{
document.getElementById(‘txt’).value=c;
c=c+1;
t=setTimeout(“timedCount()”,1000);
}

function doTimer()
{
if (!timer_is_on)
{
timer_is_on=1;
timedCount();
}
}

function stopCount()
{
clearTimeout(t);
timer_is_on=0;
}
</script><script type=“text/javascript”>
function resizeWindow()
{
top.resizeTo(500,300);
}
</script>
<style type=“text/css”>
body {background-color: RGB(100,100,222);}
</style>
</head>

<body>
<form>
<input type=“button” value=“Start count!” onclick=“doTimer()” />
<input type=“text” id=“txt” />
<input type=“button” value=“Stop count!” onclick=“stopCount()” />
</form>

</body>
</html>

Javascript libraries like jQuery and Prototype abstract this and make it REALLY SIMPLE to do.
But using bare-bones Javascript you can access the “style.backgroundColor” attribute of a DOM element.
In addition, you can apply a new CSS class to an element with “element.className=newClass”
Try a Google Search like [URL=“www.google.com/search?q=css+background+color+in+javascript”]this one for all the details you need.