![]() |
|
||||||
ColorsIf you plan on involving JavaScript a bit more in your Web Pages, you can set the background and foreground colors using JavaScript. The foreground will be the color of the text on your webpage. The built-in functions below will set these properties:
You can either set the colors using the name of the color, or you can use the hexadecimal format. I am sure you have seen them before, but here is an example anyway... Keyboard EventsThe most common keyboard event used is the onkeypress event. This even can check to see if a key is pressed on the keyboard. Here's a list of some keyboard events.
These keyboard events can get quite interesting if you're familiar with the ASCII values of the key's on the keyboard. Check out this code sample: In order for this to work, press the capital "A" and the textbox will indicate you doing so. If you were to press anything else, the program would not work. ConclusionI feel that by now I have covered a wide range of the basics of programming in javascript and writing your own programs. You could go into more detail of each topic covered, but the intent is to introduce you to it, and it will be up to you to follow through with the language. I hope that the extra code samples and the sample code programs did provide additional understanding of the concepts. Javascript is relatively easy to learn and can be quite useful for your Web Pages. I hope that you found this tutorial helpful on your way to learning something new. -bs0d | www.allsyntax.com
No Comments for this page. |
|
|||||||||||||||||||||||||||