DEV Community

Discussion on: I recreated the Twitter 'Who to follow' card

Collapse
 
zer0 profile image
zer0 • Edited

I like it.
Looks neat and even modern Light/dark theme support.

Here some advices for your JS code:
Take a look at the classList property.
It’s a cleaner way to work with class dynamic/toggling since it handles classes “array-like” and also offer methods like toggle.
Additionally you might not wanna use innerHTML to change only the text as it might cause unwanted behaviour. Use innerText instead.

Collapse
 
riyanagueco profile image
Riri

Oooh! Thank you so much! I knew there was a toggle somewhere but I wasn't sure, I should've Google'd it.

Code should be updated now. Thank you for your help! 😁

Collapse
 
zer0 profile image
zer0

Still using className in the body variable