From 6284b1d4bf7dea3abb0feffe0d1eb0245c609a5e Mon Sep 17 00:00:00 2001 From: Liam Simmons Date: Wed, 15 May 2024 09:02:57 -0400 Subject: [PATCH] Add event listener function --- index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.js b/index.js index e36025b00..21973b5d1 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,9 @@ function addingEventListener() { + const input = document.getElementById('button'); + input.addEventListener('click', function() { + alert('I was clicked!'); +}) } + +addingEventListener(); +