In this example we are going to Change CSS of Form on Button Click event.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Changing Text and Background color on button Click</title>
<script language="javascript" type="text/javascript">
var toggle=false;
function doIt()
{
if(toggle)
{
document.exf1.t1.style.color="green";
document.exf1.t1.style.backgroundColor="orange";
}
else
{
document.exf1.t1.style.color="#000440";
document.exf1.t1.style.backgroundColor="#d0d0d0";
}
document.exf1.toggle.value=toggle=!toggle;
}
</script>