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.

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

function timedCount()

function doTimer()
if (!timer_is_on)

function stopCount()
</script><script type=“text/javascript”>
function resizeWindow()
<style type=“text/css”>
body {background-color: RGB(100,100,222);}

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


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=“”]this one for all the details you need.