August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.form. button.type
The type property provides access to the TYPE attribute of the button. This property is a read-only string that always contains button.
Listing 7.33 creates buttons that relate to various math problems. The type property is used to determine the number of buttons on the page. This number is then used in the instructions displayed on the bottom of the page.
<html> <h2>The Math Page</h2> <form name="mathForm"> <input type="button" name="4plus2" value="(4 + 2)" onClick="document.mathForm.answer.value='(4 + 2) = 6'"> <input type="button" name="4minus2" value="(4 - 2)" onClick="document.mathForm.answer.value='(4 ... |
Read now
Unlock full access