An introduction to JavaScript event listeners for web designers who are new to front-end code. It shows three ways to attach a listener (HTML onevent attributes, jQuery's event method and the DOM addEventListener() method) and builds a basic click-to-reveal and hide interaction.
What you’ll learn
✓Attach a JavaScript event listener to an HTML element
✓Compare onevent attributes, jQuery's event method and addEventListener()
✓Build a basic click-driven reveal and hide interaction