HTML DOM Input Number readOnly Property Last Updated : 02 Jan, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The Input Number readOnly Property is used to set or return whether a number Field should be read-only or not. It means that a user can not modify or change the content already present in a particular Element. However, a user can tab to it, highlight it, and copy the text from it. Whereas JavaScript can be used to change the read-only value and make the input field editable. Syntax: It is used to return the readOnly property.numberObject.readOnlyIt is used to set the readOnly property.numberObject.readOnly = true|falseProperty Values: true: It defines that number field is read only.false: It is the default value. It defines that number field is not read only.Return Value: It returns a boolean value which represent the number field is read only or not. Example 1: This example illustrates how to return the property. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Number readOnly Property </title> </head> <body style="text-align:center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Number readOnly Property</h2> <input type="number" id="myNumber" step="5" placeholder="multiples of 5" readonly> <br><br> <button onclick="myFunction()"> Click Here! </button> <p id="result"></p> <script> function myFunction() { // return Input number readonly property let x = document.getElementById("myNumber").readOnly; document.getElementById("result").innerHTML = x; } </script> </body> </html> Output: Example 2: This example illustrates how to set the Property. html <!DOCTYPE html> <html> <head> <title> HTML DOM Input Number readOnly Property </title> </head> <body style="text-align:center;"> <h1>GeeksforGeeks</h1> <h2>HTML DOM Input Number readOnly Property</h2> <input type="number" id="myNumber" step="5" placeholder="multiples of 5" readonly> <br><br> <button onclick="myFunction()"> Click Here! </button> <p id="result"></p> <script> function myFunction() { // setting the input number readonly property. let x = document.getElementById("myNumber") .readOnly = false; document.getElementById("result").innerHTML = x; } </script> </body> </html> Output: Supported Browsers: Google ChromeEdge 12 and aboveFirefoxOperaSafari Comment More infoAdvertise with us Next Article HTML DOM Input Number readOnly Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Input Number value Property The DOM Input Number value Property in HTML DOM is used to set or return the value of a value attribute of the number field. The value attribute specifies the initial value of the input number Field. It contains the default value or the user types. Syntax: It returns the value property.numberObject. 2 min read HTML | DOM Input Month readOnly Property The DOM Input Month readOnly property in HTML DOM is used to set or return whether the Input Month Field should be read-only or not. It can be copied but can't be modified. Syntax: It returns the readOnly property.monthObject.readOnlyIt is used to set the readOnly property.monthObject.readOnly = "tr 2 min read HTML | DOM Input Number type Property The DOM Input Number type Property in HTML DOM is used to return the type of form element of the number field. It always returns the "number" for an Input number field. Syntax: numberObject.type Return Values: It returns a string value which represents the type of form element of the Number field Th 1 min read HTML | DOM Input Number step Property The DOM Input Number step Property is used to set or return the value of the step attribute of a number field. The step attribute in HTML is used to set the discrete step size of the element. The default stepping value for number inputs is 1. The step attribute could be used with min and max attribu 2 min read HTML DOM Input Tel readOnly Property The DOM Input tel readOnly property is used to set or return whether the tel field should be read-only or not. It means that a user cannot modify or changes the content already present in a particular element (However, a user can tab to it, highlight it, and copy the text from it) whereas a JavaScri 2 min read Like