Checkbox.defaultChecked : CheckBox « Form « JavaScript Tutorial

Home
JavaScript Tutorial
1.Language Basics
2.Operators
3.Statement
4.Development
5.Number Data Type
6.String
7.Function
8.Global
9.Math
10.Form
11.Array
12.Date
13.Dialogs
14.Document
15.Event
16.Location
17.Navigator
18.Screen
19.Window
20.History
21.HTML Tags
22.Style
23.DOM Node
24.Drag Drop
25.Object Oriented
26.Regular Expressions
27.XML
28.GUI Components
29.Dojo toolkit
30.jQuery
31.Animation
32.MS JScript
JavaScript Tutorial » Form » CheckBox 




Syntax

document.form.checkbox.defaultChecked

The defaultChecked property holds the initial state of a check box as defined by the checked attribute of the tag.

It is a read-only Boolean value.

<html>
    <form name="orderForm">
      <input type="checkbox" name="door4">doors<br>
      <input type="checkbox" name="door2" checked>doors<hr>
      Step 2:
      <input type="button" value="Submit Order" name="orderButton" onClick="alert('submitted')">
      <input type="button" value="Reset Checkboxes" name="resetButton" onClick="resetCheckboxes()">
    </form>
    <script language="JavaScript">
    <!--
    function resetCheckboxes()
    {
      document.orderForm.door4.checked = document.orderForm.door4.defaultChecked;

      document.orderForm.door2.checked = document.orderForm.door2.defaultChecked;
    }
    -->
    </script>
    </html>














10.7.CheckBox
10.7.1.Checkbox
10.7.2.Checkbox.blur()
10.7.3.Checkbox.checked
10.7.4.Checkbox.click()
10.7.5.Checkbox.defaultChecked
10.7.6.Checkbox.focus()
10.7.7.Checkbox.form
10.7.8.Checkbox.handleEvent()
10.7.9.Checkbox.name
10.7.10.Checkbox.onBlur
10.7.11.Checkbox.onClick
10.7.12.Checkbox.onFocus
10.7.13.Checkbox.type
10.7.14.Checkbox.value
10.7.15.Check if a CheckBox checked
10.7.16.With with RADIO and CheckBox
10.7.17.Use checkbox to control the window style
10.7.18.A Checkbox and an onclick Event Handler
10.7.19.A Checkbox, an onclick Event Handler and show/hide form controls
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.