A copy of the JavaScript functions in the head element:
// sample-1-event-examples-functions.js
// These are all about the same except onsubmit has a return value
// onmouseover event handler
function loaded()
{
var result_area = document.getElementById("result");
result_area.value = "load event occurred";
}
// onmouseover event handler
function mouse()
{
var result_area = document.getElementById("result");
result_area.value = "mouseover event occurred";
}
// alternate mouseover event handler
// only works for the specified location of the result area
// the first childNodes[1] gets the div element (in the body)
// the second childNodes[1] gets the input element (in the div)
function alternate_onmouseover()
{
document.body.childNodes[1].childNodes[1].value = "mouseover event occurred";
}
// onmouseout event handler
function mouseout()
{
var result_area = document.getElementById("result");
result_area.value = "mouseout event occurred";
}
// onclick event handler
function clicked()
{
var result_area = document.getElementById("result");
result_area.value = "click event occurred";
setTimeout("timedOut()", 3000);
}
// timeout event handler
function timedOut()
{
var result_area = document.getElementById("result");
result_area.value = "3 seconds passed";
}