From cc5c958e9177513e5fe6f29f6ed935cc714c82d9 Mon Sep 17 00:00:00 2001 From: ockley Date: Mon, 4 May 2026 15:07:32 +0200 Subject: [PATCH] Oversat til dansk --- .../1-createtextnode-vs-innerhtml/solution.md | 8 +- .../1-createtextnode-vs-innerhtml/task.md | 4 +- .../10-clock-setinterval/solution.md | 22 +- .../solution.view/index.html | 107 +++--- .../source.view/index.html | 16 +- .../10-clock-setinterval/task.md | 6 +- .../11-append-to-list/solution.md | 4 +- .../11-append-to-list/task.md | 4 +- .../12-sort-table/solution.md | 14 +- .../12-sort-table/solution.view/index.html | 53 +-- .../12-sort-table/source.view/index.html | 52 +-- .../12-sort-table/task.md | 16 +- .../4-clear-elem/solution.md | 10 +- .../4-clear-elem/task.md | 12 +- .../5-why-aaa/solution.md | 10 +- .../07-modifying-document/5-why-aaa/task.md | 12 +- .../6-create-list/solution.md | 2 +- .../6-create-list/solution.view/index.html | 35 +- .../6-create-list/task.md | 17 +- .../build-tree-dom.view/index.html | 84 +++-- .../innerhtml.view/index.html | 72 ++-- .../7-create-object-tree/solution.md | 6 +- .../source.view/index.html | 38 +-- .../7-create-object-tree/task.md | 40 +-- .../8-tree-count/solution.md | 2 +- .../8-tree-count/solution.view/index.html | 106 +++--- .../8-tree-count/source.view/index.html | 92 ++--- .../8-tree-count/task.md | 8 +- .../9-calendar-table/solution.md | 14 +- .../9-calendar-table/solution.view/index.html | 119 ++++--- .../9-calendar-table/source.view/index.html | 68 ++-- .../9-calendar-table/task.md | 12 +- .../07-modifying-document/article.md | 321 +++++++++--------- .../before-prepend-append-after.svg | 108 +++++- 34 files changed, 807 insertions(+), 687 deletions(-) diff --git a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md index a38f01645..62fe57f74 100644 --- a/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md +++ b/2-ui/1-document/07-modifying-document/1-createtextnode-vs-innerhtml/solution.md @@ -1,15 +1,15 @@ -Answer: **1 and 3**. +Svar: **1 og 3**. -Both commands result in adding the `text` "as text" into the `elem`. +Begge kommandoer resulterer i at tilføje `text` "som tekst" til `elem`. -Here's an example: +Her er et eksempel: ```html run height=80
+ function clockStart() { + // sæt kun et nyt interval hvis uret ikke er startet + // ellers ville vi overskrive timerID-referencen til det kørende interval og ikke kunne stoppe uret igen + if (!timerId) { + timerId = setInterval(update, 1000); + } + update(); // <-- start umiddelbart, vent ikke 1 sekund før det første setInterval virker + } - - + function clockStop() { + clearInterval(timerId); + timerId = null; // <-- slet timerID for at indikere at uret er stoppet, så det er muligt at starte det igen i clockStart() + } + - - + + - + + + diff --git a/2-ui/1-document/07-modifying-document/10-clock-setinterval/source.view/index.html b/2-ui/1-document/07-modifying-document/10-clock-setinterval/source.view/index.html index ecf5df99a..34ce09e9c 100644 --- a/2-ui/1-document/07-modifying-document/10-clock-setinterval/source.view/index.html +++ b/2-ui/1-document/07-modifying-document/10-clock-setinterval/source.view/index.html @@ -1,12 +1,10 @@ - + - + + + - - - - - - - + + + diff --git a/2-ui/1-document/07-modifying-document/10-clock-setinterval/task.md b/2-ui/1-document/07-modifying-document/10-clock-setinterval/task.md index a1b53e337..58d898f67 100644 --- a/2-ui/1-document/07-modifying-document/10-clock-setinterval/task.md +++ b/2-ui/1-document/07-modifying-document/10-clock-setinterval/task.md @@ -2,10 +2,10 @@ importance: 4 --- -# Colored clock with setInterval +# Farvet ud med setInterval -Create a colored clock like here: +Opret et farvet ur som det her: [iframe src="solution" height=60] -Use HTML/CSS for the styling, JavaScript only updates time in elements. +Brug HTML/CSS til styling, JavaScript opdaterer kun tiden i elementerne. diff --git a/2-ui/1-document/07-modifying-document/11-append-to-list/solution.md b/2-ui/1-document/07-modifying-document/11-append-to-list/solution.md index 4e77fb5cb..d85e2b4d8 100644 --- a/2-ui/1-document/07-modifying-document/11-append-to-list/solution.md +++ b/2-ui/1-document/07-modifying-document/11-append-to-list/solution.md @@ -1,7 +1,7 @@ -When we need to insert a piece of HTML somewhere, `insertAdjacentHTML` is the best fit. +Når vi skal indsætte HTML i en liste, er `insertAdjacentHTML` det bedste værktøj. -The solution: +Løsningen: ```js one.insertAdjacentHTML('afterend', '
  • 2
  • 3
  • '); diff --git a/2-ui/1-document/07-modifying-document/11-append-to-list/task.md b/2-ui/1-document/07-modifying-document/11-append-to-list/task.md index 543cd3e46..630594e32 100644 --- a/2-ui/1-document/07-modifying-document/11-append-to-list/task.md +++ b/2-ui/1-document/07-modifying-document/11-append-to-list/task.md @@ -2,9 +2,9 @@ importance: 5 --- -# Insert the HTML in the list +# Indsæt HTML i listen -Write the code to insert `
  • 2
  • 3
  • ` between two `
  • ` here: +Skriv koden til at indsætte `
  • 2
  • 3
  • ` mellem to `
  • ` her: ```html