HTML DOM Meter max Property
Example
Change the value of the max attribute in a meter:
document.getElementById("myMeter").max="80";
Definition and Usage
The max property sets or returns the value of the max attribute of a meter.
The max attribute specifies the upper limit of the meter. The value must be greater than the value of the min attribute.
If the max attribute is not specified, the default value is 1.
Tip: The max attribute, together with the min attribute, defines the full range of the meter.
Browser Support
The max property is supported in all major browsers, except Internet Explorer.
Note: The max property is not supported in Safari 5 and earlier versions.
Syntax
Get the max property:
meterObject.max
Set the max property:
meterObject.max=number
Property Values
| Value | Description |
|---|---|
| number | A floating-point number specifying the maximum value of the meter. The default value is "1". |
Technical Details
| Return Value: | A number, a floating-point number representing the maximum value of the meter. |
|---|
More Examples
Example
Get the value of the max attribute of a meter:
var x = document.getElementById("myMeter").max;
The x variable will be:
100
Related Articles
HTML Reference: HTML <meter> max Attribute
YouTip