I have a problem with on load function

window.addEventListener('load', (event) => {
 hiddentwo.classlist.remove(`hidesection1`)
});

its always returning undefined i dont know why

html

<section id="sectiontop"
			 class="hidesection1">

css

.hidesection1 {
	display:none;
}`Preformatted text`

Hello there,

Would you mind providing more information?

What is returning undefined? What is your full code?

The best way to get help with these kinds of problems is by providing a link to a MVP on something like CodePen.

Where are you querying for (getting a reference to) the hiddentwo element?

The property on the element is classList not classlist (captial L).

1 Like