Closed iPhatty closed 6 years ago
https://github.com/fac-14/teamcoolerweek-2/blob/4b588fb49da82ef7d3bdaea8458d8c7c54c80362/dom.js#L18-L20
Not much an issue but just a tip, if you wanted to add multiple classes for styling in the future it would overwrite and remove those. If you like more classes, then using classList.add() would solve that.
Another alternative would be to use element.className += " " + "strike"; this would just append the class strike onto the end of existing classes. 👍
element.className += " " + "strike";
Great tip - thanks @iPhatty!
https://github.com/fac-14/teamcoolerweek-2/blob/4b588fb49da82ef7d3bdaea8458d8c7c54c80362/dom.js#L18-L20
Not much an issue but just a tip, if you wanted to add multiple classes for styling in the future it would overwrite and remove those. If you like more classes, then using classList.add() would solve that.