Coding task · JavaScript and TypeScript course · Module 8: Events and the DOM
Exercise: Basic Event Listener
Create a basic event listener for the alarm button in Jurassic Park.
Task
The index.html file has an alarm button #alarm-btn, a paragraph #alarm-status and a script in a <script> tag. Fill in the blanks: ___BLANK1___ is the button method that registers an event listener, and ___BLANK2___ is the name of the click event. When the button is clicked, the listener should write the alarm message into the #alarm-status paragraph. Click the button in the preview to check that the message appears.