HTML max attribute
In HTML max attribute it specifies the maximum value of an element. when the max attribute is used by the progress element, it specifies how much work the task requires in the total task.
Syntax
<element max="value" >
Supported Tags:
The max attribute is used on the following elements:
Name |
Description |
---|---|
Maximum value or limit for a parameter or variable. |
|
The highest possible measurement value on a metering device. |
|
The maximum level of advancement or completion reached in a process. |
HTML max attribute Examples
Example: In this example we demonstrates the use of the max attribute in an input field, limiting the input to multiples of 5 up to a maximum value of 100.
HTML
<!DOCTYPE html> < html > < body > < h2 >HTML max Attribute in Input Field</ h2 > < form id = "myBeginner" > < input type = "number" id = "myNumber" step = "5" name = "Beginner" placeholder = "multiples of 5" max = "100" /> </ form > < br /> < br /> < p style = "font-size: 20px" > The maximum value for an input field is 100. </ p > </ body > </ html > |
Output:
Example 2: This Example we are using the max attribute within the <progress> tag to indicate a maximum value of 100 for a song download progress bar.
HTML
<!DOCTYPE html> < html > < head > < title >max Attribute</ title > </ head > < body > < h2 > HTML max Attribute used in Progress Tag </ h2 > Downloading progress for a song: < progress value = "50" max = "100" > </ progress > </ body > </ html > |
Output:
Supported Browsers: The browser supported by HTML max Attribute are listed below:
Contact Us