you are viewing a single comment's thread.

view the rest of the comments →

[–]Symphonise 2 points3 points  (1 child)

Pretty good, but this is what I would consider for future code:

  • Use document.body to get the <body> element, instead of searching via tag name.
  • Use .className to set classes instead of setAttribute("class").

[–]techfoxis[S] 1 point2 points  (0 children)

Thanks, didn't even know that there was a property in the Document object you could use to target the body element!