From 874880d71272bb69437eb35b817f2f8e55799e20 Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 14 May 2025 13:29:38 -0400 Subject: [PATCH] Add event listener logic --- .gitignore | 1 + index.js | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index a85e3847d..a4724859d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ jspm_packages !/log/.keep /tmp +package-lock.json \ No newline at end of file diff --git a/index.js b/index.js index e36025b00..41344406b 100644 --- a/index.js +++ b/index.js @@ -1,2 +1,9 @@ function addingEventListener() { + const input = document.getElementById('button'); + + function clickAlert() { + alert('I was clicked!'); + } + + input.addEventListener('click', clickAlert); }