| I'm a Human Calculator |
| <SB>Hexadecimal is a base-16 numbering system, which contains the base values 0-F. That is, beyond 9 comes A, B, C, D, E, and F. Your common decimal system uses base-10 numbering, which only has the base values 0-9. Converting a decimal number, which you're used to, to a hexadecimal number, requires some addition and multiplication.
In this chapter, you're only considering 2-digit hexadecimal numbers which represent red, green, or blue values (although in decimal, these same values would be 3 digits long, since decimal has fewer possible values for one digit to hold). To convert a hexadecimal number to decimal, use the following formula: (lefthand hexadecimal digit * 16) + (righthand hexadecimal digit) Note that a hex. digit of A = 10, B = 11, etc., to F = 15 What?? Consider the hexadecimal value 05 (0 * 16) + (5) = decimal value of 5 Okay, that one was easy. Consider the hexadecimal value 1A (1 * 16) + (10) = decimal value of 26 Another example: hexadecimal value C5 (12 * 16) + (5) = 197 Finally, the maximum 2-digit hex value: FF (15 * 16) + (15) = 255 This should give you enough knowledge to guesstimate hex values for the color specification--from there, you can fiddle with the exact values to create the exact color you're looking for. |
document.bgColor = "#00FF00"
document.bgColor="#000000"
document.bgColor="black"
document.anchors[0] document.anchors[1] ... document.anchors[5]
document.links[0] document.links[1] ...etc.
document.write ("<H1>Thank you for ordering!</H1>")
document.write (phrase)
| Watch Your HEAD |
| The <BODY> tag occurs very early on in the HTML document. This highlights the need to define your functions as early on in the document as possible--specifically, within the <HEAD> </HEAD> section, which is one of the only places you have an opportunity to do so prior to the <BODY> tag. |
<BODY onLoad="welcome()">
<BODY onLoad="welcome()" onUnload="bye()">
![]() |
![]() |


