I've been a professional C, Perl, PHP and Python developer.
I'm an ex-sysadmin from the late 20th century.
These days I do more Javascript and CSS and whatnot, and promote UX and accessibility.
toggle CHANGES the name of the class ("firstColor") to another name ("secondColor").
tdObj.classList.toggle("secondColor") gives the td a class of secondColor if it doesn't already have one, and removes it if it's there. It doesn't have any effect on other classes, such as firstColor.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
tdObj.classList.toggle("secondColor")
gives thetd
a class ofsecondColor
if it doesn't already have one, and removes it if it's there. It doesn't have any effect on other classes, such asfirstColor
.