Try
clicking on the text in the boxes above.
On
this page we are calling a function from a text link. We don't really
want to go to a link so we put in a '#' in the HTML link tag as shown
below.
<a href="#"OnClick="Yellow()">yellow"</a>
When
the link is clicked the function is called. Remember the function is
defined in the <HEAD> of our document.
<script language="JavaScript">
<!--//
function Yellow() {document.bgColor="yellow"} //-->
WARNING:
JAVA SCRIPT IS CASE SENSITIVE!
When
written between <Script> tags the background color attribute MUST
be written as: bgColor. Function names are also case sensitive in JavaScript.