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