fac-14 / teamcoolerweek-2

To-do-list project
1 stars 1 forks source link

className override #25

Closed iPhatty closed 6 years ago

iPhatty commented 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.

iPhatty commented 6 years ago

Another alternative would be to use element.className += " " + "strike"; this would just append the class strike onto the end of existing classes. 👍

sbinlondon commented 6 years ago

Great tip - thanks @iPhatty!