<!-- This is the START of Part 2 --> <!-- This is the END of Part 2 -->
<FORM> <INPUT TYPE="BUTTON" VALUE="Change Color" onClick="java_change_color();"> </FORM>
The finished function might look something like the following.
(Note to graders, their function
may have random number generation and a more complex "if()" if they
tried the extra credit.)
var original_color = document.bgColor;
function java_change_color() {
var color;
color = "0xffcc33";
// document.bgColor = color;
// alert( "java_change_color called" );
if (document.bgColor == original_color) {
document.bgColor = color;
} else {
document.bgColor = original_color;
}
}
<!-- This is the START of Part 4 --> <!-- This is the END of Part 4 -->
var Str;
Str = "wuzup " + document.MyForm.Input.value;
document.MyForm.Output.value = Str;
document.MyForm.Output.value = "Hi" + document.MyForm.Input.value;
var URL; var PixURLs = new Array( "http://www.photo.net/cr/maps/highways-4bit.gif", "http://www.photo.net/cr/sloth-iguana-58-sm.jpg", "http://www.photo.net/cr/corco-macaw-6-sm.jpg", "http://www.photo.net/cr/pj-shawn-46-sm.jpg", "http://www.photo.net/cr/coati-7.jpg", "http://icogsci1.ucsd.edu/~cg3xzz/costaricamap.gif" ); var RanNum = new Date().getSeconds(); RanNum = RanNum % 6; URL = PixURLs[RanNum]; document.write( '<IMG SRC="' + URL + '">' ); document.write( "<H6>" + URL + "</H6>");The scoring is something like:
<!-- This is the START of Part 5 --> <!-- This is the END of Part 5 -->
var RanNum2 = new Date().getSeconds(); RanNum2 = RanNum2 % 6;
|
©opyright 2001-2004 Mark R. Wallen
|