Checkbox name, id, and value:
When you set up a check box
using Expression Web you are allowed to specify a name and a value.
You will probably want to edit the html code to replace the name property
with an id property because you will find id to be more useful.
As noted, Expression Web allows you to specify a value for
a checkbox. In this program, although the associated label gives a
description of the option as well as its price, the example sets the value
property to the price and omits the description. This allows the value of
the checkbox to be read and used in calculations.
Reading the value
of a checkbox is easier than reading the value of a label because a checkbox
actually has a value property. Here is an example:
total = total + +document.getElementById("chkBlock").value;Why is there a + in front of the last portion?
Similarly, you can
set a checkbox value, although you will seldom have a reason to do so.
Here is an example: