first, we ned the html-and body-tags, create a new html-file on your desktop and write the following:
Quote
<html>
<body>
<script language = "JAVASCRIPT">
</script>
</body>
</html>
<body>
<script language = "JAVASCRIPT">
</script>
</body>
</html>
browser interpretation:
html - tag means "hey, browser, here comes HTML"
in the body-tag you define the looking of your site. you can add things like "bgcolor" for the background, "text" for the textcolor and link / alink / hlink / vlink to define the linkcolor
(<body bgcolor='#000000' text='#FFA500' link='#FFA500' vlink='#FFA500'>)
the scripttag is the tag, we'll need now (sorry, but my english isn't very well)
modify your file and type in the SCRIPT - TAG:
function bgcsel(color){
document.bgColor=color;
}
this is the function, witch will change the bgcolor. now we'll type the rest, to let the function go:write between the html tags
<input type = radio onClick = java script:bgcsel('#FFA500')>switch to Orange
<input type = radio onClick = java script:bgcsel('#FF0000')>switch to Red
<input type = radio onClick = java script:bgcsel('#000000')>switch to Black
now, when you look at the site andd klick on a radiobutton, the bgcolor will change
BTW: try to replace the "onClick" by "onMouseover"
the final file looks like this:
<html>
<body>
<script language = "JAVASCRIPT">
function bgcsel(color){
document.bgColor=color;
}
</script>
</body>
</html>
simple color changer














