HTML | DOM Input Checkbox defaultValue Property Last Updated : 23 Sep, 2022 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Input Checkbox defaultValue Property is used to set or returns the default value of an Input Checkbox field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value contains the current value after making some changes. This property is useful to find out whether the input checkbox field has been changed or not. Syntax: It returns the defaultValue property.checkboxObject.defaultValueIt is used to set the defaultValue property.checkboxObject.defaultValue = value Property Values: It contains single property value value which defines the default value for Input checkbox field. Return Value: It returns a string value which represent the default value of the Input checkbox field. Example 1: This example illustrates how to return Input checkbox defaultValue Property. HTML <!DOCTYPE html> <html> <head> <title> DOM Input Checkbox defaultvalue Property </title> </head> <body style="text-align: center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>DOM Input Checkbox defaultvalue Property</h2> <form> <!-- Below input elements have attribute checked --> <input type="checkbox" name="check" id="GFG" value="1" checked>Checked by default<br> <input type="checkbox" name="check" value="2"> Not checked by default<br> </form> <br> <button onclick="myGeeks()"> Submit </button> <p id="sudo" style="color:green;font-size:30px;"></p> <!-- script to return Input Checkbox value Property --> <script> function myGeeks() { var g = document.getElementById("GFG").defaultValue; document.getElementById("sudo").innerHTML = g; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Example 2: This example illustrates how to set Input checkbox defaultValue Property. HTML <!DOCTYPE html> <html> <head> <title> DOM Input Checkbox defaultvalue Property </title> </head> <body style="text-align: center;"> <h1 style="color:green;"> GeeksforGeeks </h1> <h2>DOM Input Checkbox defaultvalue Property</h2> <form> <!-- Below input elements have attribute checked --> <input type="checkbox" name="check" id="GFG" value="1" checked>Checked by default<br> <input type="checkbox" name="check" value="2"> Not checked by default<br> </form> <br> <button onclick="myGeeks()"> Submit </button> <p id="sudo" style="color:green;font-size:30px;"></p> <!-- script to return Input Checkbox value Property --> <script> function myGeeks() { var g = document.getElementById("GFG").defaultValue = "2"; document.getElementById("sudo").innerHTML = g; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browsers: The browsers supported by DOM Input Checkbox defaultValue Property are listed below: Google ChromeInternet ExplorerFirefoxApple SafariOpera Comment More infoAdvertise with us Next Article HTML DOM Input Color defaultValue Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML DOM Input Color defaultValue Property The DOM Input Color defaultValue Property in HTML DOM is used to set or return the default value of a Color picker. It is the value specified in the value attribute. Syntax: It returns the defaultValue property.colorObject.defaultValueIt is used to set the defaultValue property.colorObject.defaultVa 2 min read HTML DOM Input Checkbox defaultChecked Property The defaultChecked property in HTML DOM reflects the default checked state of an input checkbox as specified in the HTML. It indicates whether the checkbox was initially selected or not, without reflecting changes made after the page loads.SyntaxcheckboxObject.defaultCheckedReturn Values: It returns 2 min read HTML | DOM Input Date defaultValue Property The Input Date defaultValue Property in HTML DOM is used to set or return the default value of a date field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicate the default value and the value contains 2 min read HTML | DOM Input Checkbox disabled Property The Input Checkbox disabled property in HTML DOM is used to set or return whether the Input Checkbox field must be disabled or not. A disabled checkbox is unclickable and unusable. It is a boolean attribute and used to reflect the HTML Disabled attribute. Syntax: It returns the Input Checkbox disabl 2 min read HTML | DOM Input URL defaultValue Property The DOM Input URL defaultValue Property in HTML DOM is used to set or return the default value of the URL Field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value cont 2 min read HTML DOM Input Tel defaultValue Property The Input Tel defaultValue property in HTML DOM is used to set or return the default value of the input tel field. This property is used to reflect the HTML value attribute. The main difference between the default value and value is that the default value indicates the default value and the value co 2 min read Like