From 25f0d344260b003f2b6c5bcb14936847fbd1c4b6 Mon Sep 17 00:00:00 2001 From: Harald Fernengel <547273+haraldF@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:39:03 +0200 Subject: [PATCH] Add missing slides --- lesson09.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/lesson09.md b/lesson09.md index 9813df7..57567e7 100644 --- a/lesson09.md +++ b/lesson09.md @@ -97,6 +97,51 @@ console.log(me.address.country); --- +### Recap: onclick Event + +The `onclick` event is a specific type that happens when a user clicks on an element, like a button, link, or image. + +--- + +### Example + +```html + +``` + +In this example, When a user clicks the button, it triggers the sayHello function + +```js +function sayHello() { + console.log('Hello, World!'); +} +``` + +--- + +### oninput + +There are many more events similar to `onclick`: + +[MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/Element#mouse_events) + +We can use the `oninput` event to run a function every time the user inputs something in an input field. + +--- + +### Example + +```html + + +``` + +--- + ### HTML and Javascript HTML (Structure): HTML provides the basic structure of a webpage. It defines elements like headings, paragraphs, images, and more. It's like the skeleton of a webpage. @@ -112,6 +157,7 @@ HTML (Structure): HTML provides the basic structure of a webpage. It defines ele ``` + --- ### Manipulate HTML Elements from JavaScript