I am working on a selection menu that includes a smarty foreach loop to display game venues, dates, and logos. When a user taps on a specific game, I want to change the background color of that div to green.
<div class="leftgame-container">
{foreach from=$game_arrayleft item=row}
<div class="left-column">
<div class="team-logo">
<img width="72" height="68" src="../public/img/logo/{$row.logo}" alt="Teamlogo">
</div>
<div class="team-name">
{$row.venue}<br>
{$row.game_date|date_format:"%e. %B %Y"}
</div>
<div class="team-check">
{if $row.status eq 1}
{html_checkboxes name='gamecheck' values=$row.id separator='<br />'}
{/if}
</div>
</div>
{/foreach}
</div>
After implementing a jQuery function to add the "greenBackground" class when a user clicks on a hyperlink, I encountered an issue where the background color persists when moving to the next game div. How can I remove this added class upon selecting a new game? Your assistance is greatly appreciated. Thank you.