I have a problem with on load function

window.addEventListener('load', (event) => {

its always returning undefined i dont know why


<section id="sectiontop"


.hidesection1 {
}`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

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.