|
|
| INTRODUCTION |
Check Boxes in HTML are part of forms. In doing research and learning new tricks with JavaScript, I came across a way to incorporate check boxes with a button to select all of your check boxes. First, let's recap the syntax of a check box, which belongs in the <body> tags:
Once you have your check boxes made, creating this button in JavaScript is fairly easy. Following your check boxes and within the <form> tag, you have to create a button. The button also belongs within the <body> tags. The syntax for a button looks as follows:
Now, let's add the check boxes and the button to the <body> of an HTML document with the event onclick. The onclick event will allow us to automatically check all the check boxes with a click of the button. The syntax for this is:
To see this code run, check out the following: What ISP classes have you taken and passed? (Toot 193) This is just one example of how you can incorporate check boxes with buttons. Also, you could have a button to "Uncheck All" by setting your check box value in the button tag to checked=false. |
| JAVASCRIPT HISTORY | |
| JAVASCRIPT BASICS | |
| SCRIPT ELEMENT | |
| STATUS LINES | |
| CHECK BOXES | |
| TEXT BOXES | |
| RADIO BUTTONS | |
| SUBMIT/RESET BUTTONS | |
| INTERACTIVE BUTTONS | |
| HIDDEN FIELDS | |
| ROLLOVER IMAGES | |
| POP-UP WINDOWS | |
| MATH OBJECTS | |
| DISPLAYING THE TIME | |
| BROWSER DETERMINER | |
| OTHER JAVASCRIPT | |
| LINKS | |
| REFERENCES | |
| MY VISION | |
| SITE MAP | |
Page Created By: Peter LaMonica |
|
This page was last modified on May 8th, 2002. |
|