79615042

Date: 2025-05-10 01:17:22
Score: 1
Natty:
Report link

Add a class name to the button before appendChild, and add all the static styling in the CSS file.

JS:

button.className = 'lobby-button';

CSS:

.lobby-button:hover {
 background-color: light-blue;
}

In case you need to add styling only using JS, other solutions are available here

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Pooja Jethva