Lecture 13 Demo

Function declaration, parameters/arguments, event listeners, and preventDefault.

Classroom tip: Open DevTools console and run these commands live:

eventsDemo.showCount(), eventsDemo.setCount(5), eventsDemo.incrementBy(3), eventsDemo.previewBill(1000, 0.18), eventsDemo.applyGreeting("Aman")

1) Function + Click Event

0

Each click calls a function and updates the DOM.

2) Input Event

Hello, Guest

3) Submit Event + preventDefault()

Total: Not calculated