Home › Forums › CSS › codepen doesn’t like my js? › Re: codepen doesn’t like my js?
December 3, 2012 at 9:05 am
#116158
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.