August 1999
Intermediate to advanced
1488 pages
72h 53m
English
onClick="command"
The onClick event handler is defined in an <input> tag and specifies what to do when a check box is clicked.
The code in Listing 7.45 uses the onClick event handler to display a message alerting the customer that sausage goes well with peppers.
<html> <h2>Pizza Machine</h2> Step 1: Please select your pizza toppings:<BR> <form name="orderForm"> <input type="checkbox" name="peppers" onClick="recommendSausage()">Peppers<br> <input type="checkbox" name="sausage">Sausage<hr> Step 2: <input type="button" value="Order Pizza" name="orderButton" onClick="alert('Your pizza has been ... |
Read now
Unlock full access