I have a set of four cards labeled "card", each representing different body parts: eyes, torso, arms, and legs.
<div class="card" data-lesson="eyes">eyes</div>
<div class="card" data-lesson="torso">torso</div>
<div class="card" data-lesson="arms">arms</div>
<div class="card" data-lesson="legs">legs</div>
Whenever the user clicks on a card, that specific card receives the designation of "reading". Furthermore, the browser captures the data attribute value from the clicked card and stores it locally in an array.
$(".card").click(function(){
$(this).addClass("reading")
localStorage.setItem("readingCards" , readingCards)
});
My goal is to ensure that post-reload, any card matching a stored data attribute in the array will automatically be assigned the "reading" class, allowing for consistent visual cues even after page refreshes.