I am posting my html code for a list:
<ul>
<li>Notebook</li>
<li>Jello</li>
<li>Spinach</li>
<li>Rice</li>
<li>Birthday Cake</li>
<li>Candles</li>
</ul>
I want to apply the following css class on each element of the list:
.done {
text-decoration: line-through;
}
Basically I want to be able to strike it then undo it using toggle. I am able to do it just for the first element of the list. How do I apply for second element and onward since class List. toggle works only with query Selector which selects only the first element of an array. I am a beginner at JavaScript.