Beginner
Count and mark finished tasks
The list has tasks; finished ones carry data-done="true".
1. Write the total number of tasks into #total.
2. Write the number of finished tasks into #done.
3. Add the class done to every finished task (the CSS crosses them out).
Work the numbers out with JavaScript, so they stay right if the list changes.
What Check tests
#totalshows 5#doneshows 2- Exactly the finished tasks have the class
done - The numbers are counted, not typed in
- No errors
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.