How to make individual table cells clickable? (Bootstrap and Slim Gem)

63 Views Asked by At

I have a table, populated with many table cells with a class 'td.event' , I want to ensure that each td is clickable, multiple times, that in turn triggers CSS changes via a other function.

I have the code below, but this results in the below Syntax error via Rails server upon loading the page.

syntax error, unexpected =>

Slim Attempt:

td.event
        == activity_cell.subtitle, :onclick => "classSetter()".html_safe

Javascript:

 javascript:
  function classSetter() {
    var divs = document.querySelectorAll('td.event'), i;
    for (i = 0; i < divs.length; ++i) {
     divs[i].classList.add('unClicked');
  }};
0

There are 0 best solutions below