In Codepen, put your JS in the JS window. Then if you want to use a library, click the gear icon and select the one you want, like jQuery. That’s probably why it isn’t working. Also just looking at your code, it looks like it still won’t work because you’re not passing the event object to the handler function.
Viewing 2 posts - 1 through 2 (of 2 total)