I would like to be able to change the color of a gridbox at runtime based on the text in the box. I have a JS function called checkColor(str) which will return a color but I can't figure out the correct syntax to get it to work.
<div class="grid-item" style="background-color:checkColor(Swim)">
{{bunk.activities[_-1]}}
</div>
<script>
function checkColor(s){
if (s == "Swim"){
return 'red'
}
}
</script>