I have a table which I would like to hide certain cells depending on when their value is a certain value.
I have the below code as shown below.
var table = document.getElementById('myTable');
cells = table.getElementsByTagName('td');
for (var len=cells.length, i=0 ; i<len; i++)
if(cells[i].innerText = "New Client")
cells[i].style.display = 'none';
When I use this function, instead of only hiding the cells with the values "New Client", instead it is hiding nearly all other cells, only leaving a few cells showing.
does anyone know why this could be?