html tutorial - max Attribute in HTML - html5 - html code - html form
Learn html - html tutorial - Max attribute in html - html examples - html programs
- The max attribute defines the Maximum value of the element.
- In the <progress> element, the max attribute defines how much the task requires in total.
Syntax for max attribute in HTML:
Differences between HTML 4.01 and HTML5 for max attribute:
HTML 4.01
- The <meter> tag has not been defined.
HTML 5
- The <meter> tag is unique.
Applies To:
Element | Attribute |
---|---|
<meter> | max |
<input> | max |
<progress> | max |
max Attribute Values:
Value | Description |
---|---|
number | Defines a floating-point number which is treated to be a maximum value. |
date | Describes the maximum date allowed. |
Sample Coding for max Attribute in HTML:
Code Explanation for max Attribute in HTML:
- <meter> tag is used to display a measurement with a graphical view in a range.
- value attribute used to define the value of the <meter>.
- max attribute is used to set the maximum value of the meter.
Output for max Attribute in HTML:
- The meter value is 75 and maximum value is 100, the HTML gauge (HTML-75%) can value of html.
Browser Support for max Attribute in HTML:
element | |||||
---|---|---|---|---|---|
<input> | 5.0 | 10.0 | 16.0 | 5.1 | 10.6 |
<meter> | 8.0 | No | 6.0 | 6.0 | 11.0 |
<progress> | 8.0 | 10.0 | 16.0 | 6.0 | 11.0 |
Tips and Notes
- The max attribute is used together with the min attribute to create a range of legal values.
- The max and min attributes works with the following input types: number, range, date, datetime, datetime-local, month, time and week.
- The max attribute and the min attribute, which defines the full range of the gauge.