Changing the background color without "class"

Can somene help me with this small code? please. The script changes the background color of the cells with the same content using “class” element. Instead I would like it to happen without using “class” element but depending on the content of the cells.

That was fun, considering my lack of experience :slight_smile: .

Thanks Ryan, apparently you are more experienced than me :slight_smile:

There is a small issue. When I click on 2 in the cell, it highlights the cells with number 222 as well.

Slightly modified.

A JS expert might want to step in and correct any mistakes I made that my noob-self has overlooked.

thanks again, it is perfect for me.

Maybe strip out leading and following spaces from the text as they will stop it matching?


This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.