Checkbox.name

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

document.form.checkbox.name

Description

The name property provides access to the name attribute of the check box. This property is a read-only string.

Example

Listing 7.43 uses the name property of the check boxes to display what engine type was selected.

Listing 7.43 Display the Name of the Check Box with the name Property
 <html> <h2>Truck Purchase Sheet</h2> Step1: Please select the engine style you want on your new truck:<BR> <form name="orderForm"> <input type="checkbox" name="V6">V6<br> <input type="checkbox" name="V8">V8<hr> Step 2: <input type="button" value="Submit Order" name="orderButton" onClick="submitOrder()"> </form> <script language="JavaScript"> ...

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.