Progress value attribute
Definition and usage
value
Attribute sets or returns the value of the progress bar's value attribute.
<progress> value attribute 规定已完成多少任务。
HTML 参考手册:HTML <progress> 标签
Example
Example 1
Update the current value in the progress bar:
document.getElementById("myProgress").value = "80";
Example 2
Get the current value of the progress bar:
var x = document.getElementById("myProgress").value;
Syntax
Return value attribute:
progressObject.value
Set value attribute:
progressObject.value = number
属性值
值 | 描述 |
---|---|
number | 规定已完成多少任务。 |
技术细节
返回值: | 浮点数,表示任务的当前进度。 |
---|
浏览器支持
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
支持 | 10.0 | 支持 | 6.0 | 支持 |
相关页面
HTML 参考手册:HTML <progress> value 属性