Checkbox.value

JavaScript 1.0+, JScript 3.0+ Nav2+, IE 4+, Opera3+ Syntax

document.form.checkbox.value

Description

The value property provides access to value attribute of the check box. This property is a read/write value that is sent to the server when the form is submitted.

Example

Listing 7.48 uses the value property of each check box to create instructions for the customer on how to order his or her custom pizza.

Listing 7.48 Accessing a Check Box's value Property
 <html> <h2>Pizza Machine</h2> Step1: Please select your pizza toppings:<BR> <form name="orderForm"> <input type="checkbox" name="onion" value="hot onion">Onion<br> <input type="checkbox" name="bacon" value="spicy bacon">Bacon<hr> Step 2: <input type="button" value="Order ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.