Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| lehrkraefte:blc:informatik:efi-2023:js [2024/04/25 09:07] – Ivo Blöchliger | lehrkraefte:blc:informatik:efi-2023:js [2024/04/25 10:00] (current) – Ivo Blöchliger | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | * HTML | ||
| + | * CSS (Cascade Style Sheet) | ||
| + | * JS (JavaScript) | ||
| + | * Browser loop -> Video | ||
| + | |||
| + | In VSCode die Extension «Live Server» installieren. | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | |||
| + | [[https:// | ||
| + | |||
| + | |||
| + | ====== Temperatur-Rechner ====== | ||
| + | |||
| + | <code html> | ||
| + | Grad Celsius <input type=" | ||
| + | Grad Fahrenheit <input type=" | ||
| + | |||
| + | </ | ||
| + | |||
| + | <code javascript> | ||
| + | window.addEventListener(' | ||
| + | let grad = this.document.getElementById(' | ||
| + | let fahrenheit = this.document.getElementById(' | ||
| + | |||
| + | function c2f() { | ||
| + | let f = Number(grad.value)*1.8+32; | ||
| + | fahrenheit.value=f; | ||
| + | console.log(`Die Umrechnung gibt ${f}`); | ||
| + | } | ||
| + | |||
| + | grad.addEventListener(' | ||
| + | |||
| + | function f2c() { | ||
| + | let c = (Number(fahrenheit.value)-32)/ | ||
| + | grad.value=c; | ||
| + | console.log(`Die Umrechnung gibt ${c}`); | ||
| + | } | ||
| + | fahrenheit.addEventListener(' | ||
| + | |||
| + | }); | ||
| + | </ | ||