Checkbox.type

JavaScript 1.1+, JScript 3.0+ Nav3+, IE 4+, Opera3+ Syntax

document.form.checkbox.type

Description

The type property provides access to type attribute of the check box. This property is a read-only string that always contains checkbox.

Example

Listing 7.47 instructs the customer to select only two toppings (check boxes) of all those offered. To determine the number of toppings, the type property of the check box is used to determine how many check boxes are in orderForm. The program finds there are four check boxes representing the possible pizza toppings.

Listing 7.47 Accessing a Check Box's type Property
 <html> <h2>Pizza Machine</h2> Step 1: Please select your pizza toppings:<br> <form name="orderForm"> <input type="checkbox" ...

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.