<html>
<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('ordered.')">
</form>
<script language="JavaScript">
<!--
function recommendSausage()
{
if(document.orderForm.peppers.checked == true)
{
alert("Sausage goes well with peppers.");
}
}
document.write("The pepper checkbox onClick event handler: ");
document.write(document.orderForm.peppers.onclick);
-->
</script>
</html>
|