Behavior Belongs in the HTML

from blog unplannedobsolescence.com, | ↗ original
When you click the button below, it's going to show you a little message. Click me Showing a pop-up when the user clicks a button isn't something the button supports on its own; you have to code it. There are two ways to attach custom functionality to an HTML element: inline, or using an event listener. This is how you'd do it with an inline...