I'm supposed to switch the themes of the "headline" and the "text", but I can't seem to get it. Here's what I have so far...anyone have any ideas why it doesn't work? Thanks :)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Part I</title>
<style type="text/css">
h1{
color:#3333FF;
font-style:italic;
font-weight:bolder;
}
p{
color:#76B200;
font-variant:small-caps;
}
</style>
<script type="text/javascript">
var head;
function theme2setup(){
//you may want to get the headline element out of the document
head= document.getElementById("headline");
// (1) create new properties to store alternate values
//for each of the h1 properties changed in the stylesheet
head.style.color: #FF00CD;
head.style.fontStyle: normal;
head.style.fontWeight: normal;
//you may want to get the paragraph element out of the document
// (2) create new properties to store alternate values
//for each of the p properties changed in the stylesheet
//end of the function
return;
}
function themechange(){
//you may want to get the headline element out of the document
var headOrig=document.getElementById("headline");
// (3) store each of the current values in a temporary variable
var tempColor = headOrig.style.color;
var tempStyle = headOrig.style.fontStyle;
var tempWeight = headOrig.style.fontWeight;
// (4) set the current style to the alternate style
headOrig.style.color=head.style.color;
headOrig.style.fontStyle=head.style.fontStyle;
headOrig.style.fontWeight=head.style.fontWeight;
// (5) set the alternate values to the values saved in the temporary variable
head.style.color=tempColor;
head.style.fontStyle=tempColor;
head.style.fontWeight=tempColor;
//you may want to get the paragraph element out of the document
// (6) same as 3 only with the paragraph element
// (7) same as 4 only with the paragraph element
// (8) same as 5 only with the paragraph element
//end of the function
return;
}
window.onload=function(){theme2setup(); document.getElementById("themechange").onclick=themechange;};
</script>
</head>
<body>
<form action="." method="get">
<input type="button" value="Change Theme" onClick="dolt()"/>
</form>
<h1 id="headline">The Amazing Theme Changing Website</h1>
<p id="text">On the amazing theme changing website you can select from one of two themes
to view the site in. These themes are named theme 1 and theme 2. Hope you enjoy
both of the themes.</p>
</body>
</html>