w3-video.com logo

HTML5 Tutorial

Home HTML5 XAMPP .htaccess Firefox Notepad++

Share it



meter value attribute

The value attribute on the meter element:


Colors representing the measured value on meter element:

Examples

<meterattribute="value(s)">...<⁄meter>example
6.value=valid floating-point number<meter min="3" value="6" max="9"> ... <⁄meter>

Video demonstration meter value attribute

HTML5 meter value attribute Tutorial

min video details
00:00 video tutorial: value attribute on meter element
00:05 the value attribute allows you to specify the measured value = the result of the scalar measurement
it is a required attribute!
00:14 Taking this example: 45 out of 60 ,br>'45' represents the result of the scalar measurement
'60' represents the maximum value of the range
00:26 45 represents the result of the scalar measurement, we will add it as value of the value attribute
00:40 the representation of the measured value is not correct since 45 out of 60 = 0.75, so 75% and not 100% as the meter displays in browser

max attribute has been omitted; when so it's default value = 1 → 45 out of 1 instead of 45 out 60
To correct this we need to add the max value of 60 through max attribute
00:48 the representation of the measured value is now correct since 45 out of 60 = 0.75, 75% → 3 quarters of the meter have been colored in green
00:55 another way of doing it is to add straight the value of 0.75 (=45/60) to the value attribute and omit the max attribute whose default value is 1
→ 0.75 out of 1 = 0.75 = 75%
→ a correct representation
meter intro meter browser display meter parents - children meter fallback contentmeter: segments, values, colors, attributes meter syntaxmeter low, high attributesmeter min, max attributesmeter optimum attributemeter title attribute