The progress and meter Elements
Show completion and measurement values with native HTML.
The progress and meter Elements is a free HTML Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the HTML Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The progress Element
The <progress> element represents the completion of a task:
<label for="upload">File upload progress:</label>
<progress id="upload" max="100" value="72">72%</progress>
<!-- max: total amount of work (default: 1) -->
<!-- value: amount of work done -->
<!-- Content between tags: fallback for old browsers -->Indeterminate Progress
Without a value, progress shows an indeterminate animation:
<!-- Indeterminate: value not set -->
<progress id="loading">Loading...</progress>
<!-- Browser shows a cycling animation (no value known) -->
<!-- Set value when progress is known: -->
<script>
document.getElementById('loading').value = 45;
// Now shows 45% complete (with max=1: 0.45 = 45%)
</script>Animating progress with JavaScript
Update progress dynamically:
<progress id="task" max="100" value="0"></progress>
<span id="pct">0%</span>
<script>
let progress = 0;
const bar = document.getElementById('task');
const pct = document.getElementById('pct');
const interval = setInterval(() => {
progress += 10;
bar.value = progress;
pct.textContent = progress + '%';
if (progress >= 100) clearInterval(interval);
}, 500);
</script>The meter Element
The <meter> element displays a scalar measurement within a known range:
<meter min="0" max="100" value="72">72 out of 100</meter>
<!-- Unlike progress (task completion), meter shows a static measurement:
- Disk usage
- Password strength
- Score or rating
- Fuel level
-->meter Attributes
meter has several attributes for defining optimal and warning ranges:
<meter
min="0" <!-- minimum possible value -->
max="100" <!-- maximum possible value -->
low="30" <!-- threshold: below this = low -->
high="70" <!-- threshold: above this = high -->
optimum="50" <!-- where the optimal value lies -->
value="85"
>85/100</meter>meter Color States
Browsers color-code meter based on low/high/optimum:
<!-- optimum is in the low range: low values are good (e.g., error count) -->
<meter min="0" max="100" low="30" high="70" optimum="0" value="10">
10 errors <!-- green: value is in the good zone -->
</meter>
<!-- optimum is in the high range: high values are good (e.g., score) -->
<meter min="0" max="100" low="40" high="80" optimum="100" value="55">
55 points <!-- yellow: between low and high -->
</meter>Disk Usage with meter
Classic meter use case: disk or memory usage:
<label for="disk">Disk usage:</label>
<meter
id="disk"
min="0"
max="500"
low="400"
high="450"
optimum="0"
value="420"
>420 GB of 500 GB used</meter>
<p>420 GB of 500 GB used (84%)</p>Password Strength with meter
Use meter to show password strength:
<label for="pwd">Password</label>
<input type="password" id="pwd">
<label for="strength">Strength:</label>
<meter id="strength" min="0" max="4" low="1" high="3" optimum="4" value="0"></meter>
<script>
document.getElementById('pwd').addEventListener('input', function() {
const strength = calculateStrength(this.value); // 0-4
document.getElementById('strength').value = strength;
});
</script>Styling progress and meter
Custom styling for progress and meter:
/* Basic progress styling */
progress {
appearance: none;
width: 100%;
height: 8px;
border-radius: 4px;
background: #e2e8f0;
border: none;
}
progress::-webkit-progress-bar { background: #e2e8f0; }
progress::-webkit-progress-value { background: #0070f3; }
progress::-moz-progress-bar { background: #0070f3; }Accessibility of progress
Add ARIA attributes for better screen reader support:
<label for="upload">Upload progress</label>
<progress
id="upload"
max="100"
value="65"
aria-valuenow="65"
aria-valuemin="0"
aria-valuemax="100"
aria-label="File upload: 65% complete"
>65%</progress>progress vs meter Summary
Key distinction:
<progress>— task completion over time; value increases toward max; can be indeterminate<meter>— static scalar measurement; value is already known; has low/high/optimum zones
When to Use Each
Use case guide:
- progress — file upload, form completion wizard, loading bar
- meter — disk usage, fuel gauge, credit score, battery level, search result relevance
Quick Check
Which element is appropriate for showing how full a hard drive is?
Recap: progress and meter
Progress and meter essentials:
<progress max value>— task completion; indeterminate without value<meter min max low high optimum value>— static measurement- Browser auto-colors meter based on optimum position
- Add aria-valuenow/min/max for screen reader support
Frequently asked questions
Is the “The progress and meter Elements” lesson free?
Yes — the full text of “The progress and meter Elements” is free to read here on the web, and the HTML Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the HTML Academy course, upgrade to CoddyKit PRO.
What will I learn in “The progress and meter Elements”?
Show completion and measurement values with native HTML. You practise HTML Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start HTML Academy?
No prior experience is required. HTML Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “The progress and meter Elements” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this HTML Academy lesson?
Yes. Every HTML Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- aside Complementary Content
- figure and figcaption Revisited
- details and summary Disclosure Widget
- The progress and meter Elements