Baseline Widely available
HTMLProgressElement
æ¥å£ç max
屿§è¡¨ç¤º <progress>
å
ç´ çèå´çä¸éã
ä¸ä¸ªå¤§äºé¶çæµ®ç¹æ°ãé»è®¤å¼æ¯ 1.0ã
ç¤ºä¾ HTMLè¿åº¦ï¼<progress id="pBar"></progress> <span>0</span>%
JavaScript
const pBar = document.getElementById("pBar");
const span = document.getElementsByTagName("span")[0];
console.log(`max çé»è®¤å¼ï¼${pBar.max}`);
pBar.max = 100;
pBar.value = 0;
setInterval(() => {
pBar.value = pBar.value < pBar.max ? pBar.value + 1 : 0;
span.textContent = Math.trunc(pBar.position * 100);
}, 100);
è§è æµè§å¨å
¼å®¹æ§
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4