element to todoList
+
+
+window.onload = function(){
+ console.log('Hack your future Belgium!');
+
+ // EXERCISE 1
+
+ // 1a: create a function called "changeHeader", put a console.log() inside this function to test
+
+ /* function changeHeader() {
+ console.log("test 2");
+ }; */
+
+ // 1b: inside this function: select the header element and assign that to a variable called "header"
+
+ /* function changeHeader() {
+ var headerToChange = document.getElementById("myHeadChange");
+ console.log(headerToChange)
+ }; */
+
+ // 1c: change the inner html of the header element to your name
+
+ function changeHeader() {
+ var headerToChange = document.getElementById("myHeadChange");
+ headerToChange.innerHTML = "Melrose"
+ };
+
+ // 1d: add an event listener to the "Change header" button
+ //and call the "changeHeader" function when clicked ( you should see your console.log() )
+ //function changeHeader();
+ var btn_changhead = document.getElementById("btn-changeHeader");
+ btn_changhead.addEventListener("click", function(){
+ changeHeader()
+ });
+
+
+ // EXERCISE 2
+
+ // 2a: create a function called "changeImage", put a console.log() inside this function to test
+ function changeImage(){
+ console.log("test image");
+ };
+ // 1b: add an event listener to the "Change image" button and call the "changeImage" function when clicked
+ var btn_changeImage = document.getElementById("btn-changeImage");
+ btn_changeImage.addEventListener("click", function () {
+ changeImage()
+ })
+ // inside this function:
+
+ // 2c: select the "imageInput" element and assign to a variable called "imageInputValue"
+ function changeImage() {
+ var imageInputValue = "https://www.w3schools.com/w3css/img_nature_wide.jpg"
+ var imageToChange = document.getElementById("imageToChange");
+ imageToChange.src = imageInputValue;
+ };
+
+ // 2d: select the image element and assign to a variable called "imageToChange"
+ //var imageToChange =
+ // 2e: to change the image: assign the imageInputValue to the image src
+
+
+ // Exercise 3:
+
+ // 3a: select "add todo" button & add click event listener to execute addTodo() function on click event
+ var btn_addTodo = document.getElementById("btn-addTodo");
+ btn_addTodo.addEventListener("click", function () {
+ addTodo()
+ })
+ // 3b: define addTodo() function, in this function:
+
+ /* function addTodo(){
+ console.log("addTodo")
+ }; */
+
+// 3c: get todoList element
+ var todoList = document.getElementById("todoList");
+// 3d: get todoInput element & log todoInput value
+ var todoInput = document.getElementById("todoInput")
+// 3e: create a
element
+ var li = document.createElement("li");
+// 3f: set created
element innerHtml to todoInput value
+ li.innerHTML = todoInput.value
+// 3g: add
From dcd5ec90db2f11b5e978079c10919e75925fd655 Mon Sep 17 00:00:00 2001
From: bockarie <51052394+bockarie@users.noreply.github.com>
Date: Sun, 21 Jul 2019 00:46:09 +0200
Subject: [PATCH 7/9] Update maartjes-work.js
---
Week2/homework/maartjes-work.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/Week2/homework/maartjes-work.js b/Week2/homework/maartjes-work.js
index 49772eb44..118db6067 100644
--- a/Week2/homework/maartjes-work.js
+++ b/Week2/homework/maartjes-work.js
@@ -46,7 +46,14 @@ const maartjesTasks = monday.concat(tuesday);
const maartjesHourlyRate = 20;
function computeEarnings(tasks, hourlyRate) {
- // Replace this comment and the next line with your code
+ // create variables of duration and task for monday
+
+let duration = ['180', '120','20','200']
+let task = [ 'Write a summary HTML/CSS','Some web development','Fix homework for class10','Talk to a lot of people']
+ }
+});
+
+
console.log(tasks, hourlyRate);
}
From f4cda1687be0c908b394a729fa832a0d2fb9be0f Mon Sep 17 00:00:00 2001
From: bockarie <51052394+bockarie@users.noreply.github.com>
Date: Sun, 21 Jul 2019 00:57:58 +0200
Subject: [PATCH 8/9] Update map-filter.js
---
Week2/homework/map-filter.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Week2/homework/map-filter.js b/Week2/homework/map-filter.js
index c8e8a88c1..44d27187b 100644
--- a/Week2/homework/map-filter.js
+++ b/Week2/homework/map-filter.js
@@ -1,7 +1,8 @@
'use strict';
function doubleOddNumbers(numbers) {
- // Replace this comment and the next line with your code
+ // call function
+ doubleOddNumber(numbers)
console.log(numbers);
}
From f1d3c03d236e4bf8ee3f30c09b559aa6aab11510 Mon Sep 17 00:00:00 2001
From: bockarie <51052394+bockarie@users.noreply.github.com>
Date: Tue, 23 Jul 2019 00:13:26 +0200
Subject: [PATCH 9/9] Update index.js
---
Week1/exercise/w1/index.js | 51 --------------------------------------
1 file changed, 51 deletions(-)
diff --git a/Week1/exercise/w1/index.js b/Week1/exercise/w1/index.js
index 03c818a4f..07d5a5b6f 100644
--- a/Week1/exercise/w1/index.js
+++ b/Week1/exercise/w1/index.js
@@ -1,54 +1,3 @@
-console.log('Hack your future Belgium!');
-
-// EXERCISE 1
-
-// 1a: create a function called "changeHeader", put a console.log() inside this function to test
-
-// 1d: add an event listener to the "Change header" button
-// and call the "changeHeader" function when clicked ( you should see your console.log() )
-
-// 1b: inside this function: select the header element and assign that to a variable called "header"
-
-// 1c: change the inner html of the header element to your name
-
-
-// ====================================== //
-
-
-// EXERCISE 2
-
-// 2a: create a function called "changeImage", put a console.log() inside this function to test
-
-// 1b: add an event listener to the "Change image" button and call the "changeImage" function when clicked
-
-// inside this function:
-
-// 2c: select the "imageInput" element and assign to a variable called "imageInputValue"
-
-// 2d: select the image element and assign to a variable called "imageToChange"
-
-// 2e: to change the image: assign the imageInputValue to the image src
-
-
-// ====================================== //
-
-
-// Exercise 3:
-
-// 3a: select "add todo" button & add click event listener to execute addTodo() function on click event
-
-// 3b: define addTodo() function, in this function:
-
-// 3c: get todoList element
-
-// 3d: get todoInput element & log todoInput value
-
-// 3e: create a
element
-
-// 3f: set created
element innerHtml to todoInput value
-
-// 3g: add
element to todoList
-
window.onload = function(){
console.log('Hack your future Belgium!');