Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS codepen doesn’t like my js? Re: codepen doesn’t like my js?

#116158
tbwiii
Participant

He doesn’t want it to run on load, he wants it to run on click.

If you want to call the function from the HTML you need to store it as a variable, like so:

displayMain = function () {

document.getElementById(“main”).style.display=”block”;

}

That got it working for me.