HTML | DOM Input Number Object Last Updated : 25 Aug, 2022 Comments Improve Suggest changes Like Article Like Report The Input Number Object in HTML DOM is used to represent an HTML input element with type= "number". The input element with type= "number" can be accessed by using getElementById() method. Syntax: It is used to access input number object.document.getElementById("id");It is used to create input elementdocument.createElement("input"); Input Number Object Properties: PropertyDescriptiontypeThis property is used to return which type of form element the number field is.valueThis property is used to set or return the value of the value attribute of a number field.autocompleteThis property is used to set or return the value of the autocomplete attribute of a number field.autofocusThis property is used to set or return whether a number field should automatically get focus when the page loads.defaultValueThis property is used to set or return the default value of a number field.disabledThis property is used to set or return whether a number field is disabled or not.formThis property is used to return reference to the form that contains the number field.listThis property is used to return a reference to the datalist that contains the number field.maxThis property is used to set or return the value of the max attribute of a number field.minThis property is used to set or return the value of the min attribute of a number field.nameThis property is used to set or return the value of the name attribute of a number field.placeholderThis property is used to set or return the value of the placeholder attribute of a number field.readOnlyThis property is used to set or return whether the number field is read-only or not.requiredThis property is used to set or return whether the number field must be filled out before submitting a form.stepThis property is used to set or return the value of the step attribute of a number field. Input Number Object Methods: MethodDescriptionstepDown()This method is used to decrement the value of the input number by a specified number.stepUp()This method is used to increment the value of the input number by a specified number.select()This method is used to select the content of a Input Number field. Example-1: HTML <!DOCTYPE html> <html> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM Input Number Object</h2> <input type="number" id="myNumber" value="10"> <p>Click the button to get the number of the number field.</p> <button onclick="myFunction()"> Click Here! </button> <p id="demo"></p> <script> function myFunction() { // Accessining input value var x = document.getElementById("myNumber").value; document.getElementById( "demo").innerHTML = x; } </script> </body> </html> Output: Before click on the button: After click on the button: Example-2: HTML <!DOCTYPE html> <html> <body style="text-align:center;"> <h1 style="color:green;"> GeeksForGeeks </h1> <h2>DOM Input Number Object</h2> <p>Click the button to create a Number field.</p> <button onclick="myFunction()">Click Here!</button> <script> function myFunction() { // Creating input element. var x = document.createElement("INPUT"); x.setAttribute("type", "number"); x.setAttribute("value", "5678"); document.body.appendChild(x); } </script> </body> </html> Output: Before click on the button: After click on the button: Supported Browsers: Google ChromeMozilla FirefoxEdge 12 and aboveSafariOpera Comment More infoAdvertise with us Next Article HTML | DOM Input Number Object D divyatagoel0709 Follow Improve Article Tags : Web Technologies HTML HTML-DOM Similar Reads HTML | DOM Style animationDelay Property The animationDelay Property in HTML DOM is used to set or returns the delay after which the animation should start. Syntax: It is used to set the animationDelay property:object.style.animationDelay = "time|initial|inherit"It is used to return the animationDelay property:object.style.animationDelay P 3 min read HTML | DOM Window parent Property HTML DOM Window parent Property returns the parent window of the current window. It is a read-only property. If a window does not have a parent, then it refers to itself. Syntax: window.parent Return Value: Parent Window object of current window. If there is no parent window then it refers to itself 1 min read HTML DOM isDefaultNamespace() Method The DOM isDefaultNamespace() method is used to return boolean true if the specified namespace is default otherwise, it returns boolean false. The URI of the namespace required can be checked using the namespaceURI string. Syntax:node.isDefaultNamespaceReturn Value: It returns a boolean value true if 1 min read HTML | DOM Style animationName Property The animationName Property in HTML DOM is used to set or returns a name for @keyframes animation. Syntax: It is used to set the animationName property:object.style.animationName = "none|keyframename|initial|inherit"It is used to return the animationName property:object.style.animationName Property V 3 min read HTML DOM Style transition Property The HTML DOM Style Property is used to change the appearance of any DIV element. It changes the appearance whenever the mouse hovers over that element. SyntaxFor return the transition property:object.style.transitionFor set the transition property:object.style.transition = "property duration timing 2 min read HTML | DOM Textarea maxlength Property The DOM Textarea maxlength Property is used to set or return the value of the maxlength attribute of a textarea field. It specifies the maximum number of characters that have been allowed in the Element. Syntax: It is used to return the maxLength property: textareaObject.maxLength It is used to set 2 min read HTML | DOM meter Object The DOM Meter Object is used to represent the HTML <meter> element. The meter element is accessed by getElementById().Properties: form: It belongs to one or more forms that it belongs too.max: It is used to specify the maximum value of a range.min: It is used to specify the minimum value of a 2 min read HTML | DOM Textarea placeholder Property The DOM Textarea placeHolder Property is used to set or return the value of the placeholder attribute of a textarea field. It specifies a short hint that describes the expected value of an input field / textarea. A short message or hint displayed before entering value in textarea. Syntax: It is used 2 min read HTML | DOM Style backfaceVisibility Property The backfaceVisibility property is the deciding factor that would make an element visible or invisible when the element is not facing the screen. This property is helpful when an element is rotated, and its backside needs to be hidden. Syntax: Return the backfaceVisibility property:object.style.back 3 min read HTML | DOM HTML Object The HTML Object property in HTML DOM is used to represent or access the HTML <html> element with in the object. The <html> element is used to return the HTML document as an Element Object. Syntax: It is used to access a <html> element.var x = document.getElementsByTagName("HTML")[0 3 min read Like