Funky Munky > Examples > Quick-Color > Script Explanation | |||||||||
. |
The user types in a hexadecimal number, and then the background becomes that color. Here is the form: Note: Lines are numbered for clarification.
So, there's the form. When you enter something into document.a.b on line #2 and hit enter, it does the onSubmit defined on line #1, which calls up the function change(), with the textbox's value as the parameters. The script:
On line #4, it sees if there's a pound (#) sign. If there isn't, then it adds one on line #5. If there is, it leaves the variable 'x' as it is. Then it sets the document bgcolor to the variable 'x' on line #7. Next, it clears the textbox on line #8, and on line #9 it selects it. [ Funky Munky ] [ Back to main page ] [ Examples and Experiments ]
|