Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
haraldF committed Apr 16, 2024
1 parent 25f0d34 commit 18fa51f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lesson09.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ The `onclick` event is a specific type that happens when a user clicks on an ele
### Example

```html
<button onclick="sayHello()">Click Me</button>
<button onclick="sayHello();">Click Me</button>
```

In this example, When a user clicks the button, it triggers the sayHello function
Expand All @@ -132,7 +132,7 @@ We can use the `oninput` event to run a function every time the user inputs some
### Example

```html
<input type="number" oninput="inputChanged()">
<input type="number" oninput="inputChanged();">
<script>
function inputChanged() {
console.log("yay, something changed");
Expand Down Expand Up @@ -225,12 +225,12 @@ let priceDiv = document.getElementById("totalPrice");
<html>
<body>
<h1 id="greeting">Hello, World!</h1>
<button onclick="changeText()">Click Me</button>
<button onclick="changeText();">Click Me</button>

<script>
function changeText() {
let element = document.getElementById("greeting");
element.textContent = "Hi, there!";
let greetingElement = document.getElementById("greeting");
greetingElement.textContent = "Hi, there!";
}
</script>
</body>
Expand Down Expand Up @@ -266,7 +266,7 @@ Create a number input field in HTML that lets the user choose the amount of pizz

```html
Choose the amount of pizza slices:
<input type="number" id="amount" min="0" value="0" oninput="amountChanged()">
<input type="number" id="amount" min="0" value="0" oninput="amountChanged();">
```

Use the `valueAsNumber` property of the number input to get the amount that the user selected in your `amountChanged` function. Output the total price the user has to pay to a `div` element.
Expand Down Expand Up @@ -324,7 +324,7 @@ HTML:
### Solution Task 3

```html
<input type="number" id="amount" min="0" value="0" oninput="amountChanged()">
<input type="number" id="amount" min="0" value="0" oninput="amountChanged();">
<div id="priceDiv">0 EUR</div>
<script>
let hummusPrice = 5;
Expand Down

0 comments on commit 18fa51f

Please sign in to comment.