Meter optimum attribute

Definition and Usage

optimum Attribute sets or returns the value of the meter optimum attribute value.

The optimum attribute specifies the range of values considered to be the best value for the meter.

See also:

HTML Reference Manual:HTML <meter> optimum 属性

HTML Reference Manual:HTML <meter> 标签

Example

Example 1

Return the value of the optimum attribute in the meter:

var x = document.getElementById("myMeter").optimum;

Try it yourself

Example 2

Change the value of the optimum attribute in the meter:

document.getElementById("myMeter").optimum = "0.7";

Try it yourself

Syntax

Return the optimum attribute:

meterObject.optimum

Set the optimum attribute:

meterObject.optimum = number

属性值

描述
number 规定作为仪表的最佳值的浮点数。

技术细节

返回值: 数值,表示仪表的最佳值的浮点数。

浏览器支持

表中的数字注明了首个完全支持该属性的浏览器版本。

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
支持 不支持 支持 6.0 支持