Input Number min Attribute

Definition and Usage

min attribute to set or return the value of the min attribute of the numeric field.

The HTML min attribute specifies the minimum value of the numeric field.

Tip:Use the min attribute and max attribute to create a valid value range.

Tip:To set or return the value of the max attribute, use max attribute.

See also:

HTML Reference Manual:HTML <input> min Attribute

Example

Example 1

Get the minimum value allowed for the numeric field:

var x = document.getElementById("myNumber").min;

Try it yourself

Example 2

Change the minimum value:

document.getElementById("myNumber").min = "5";

Try it yourself

Syntax

Return the min attribute:

numberObject.min

Set min Attribute:

numberObject.min = number

Attribute Value

Value Description
number Specifies the minimum allowed value.

Technical Details

Return Value: A string value representing the minimum allowed value.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support