August 1999
Intermediate to advanced
1488 pages
72h 53m
English
document.form.button.click()
The click() method simulates the click event.
In Listing 7.23, two buttons are created by using the <input> tag. The first button displays an alert box when it is clicked. When the second button is clicked, it causes the first button's onClick event handler to be activated, displaying the alert box associated with the first button.
<html> <form name="myForm"> <input type="button" value="Display alert box" name="button1" onClick="alert('You clicked the first button.')"><br> <input type="button" value="Call on button 1" name="button2" onClick="clickFirstButton()"> ... |
Read now
Unlock full access