+
+
+
+
\ No newline at end of file
diff --git a/exercise/w1 Solved/index.js b/exercise/w1 Solved/index.js
new file mode 100644
index 000000000..33795afdf
--- /dev/null
+++ b/exercise/w1 Solved/index.js
@@ -0,0 +1,99 @@
+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('Testing this function');
+}
+
+// 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(){
+ console.log("Hello Now the heading is Changed with Addeventlistner");
+
+ var header= document.querySelector('header1');
+ document.getElementById("header1").innerHTML="Kelemu";
+ header = document.getElementById("header1").innerHTML;
+}
+
+document.getElementById("headerChenger").addEventListener('click',changeHeader);
+
+// 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
+
+document.getElementById('btn-changeImage'). addEventListener('click',changeImage);
+
+// 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
+function changeImage(){
+ console.log('Im in the changeImage function');
+ var imageInputValue = document.getElementById('imageInput').value;
+
+ var imageToChange = document.getElementById('imageToChange').src;
+
+ imageToChange = imageInputValue
+
+ document.getElementById('imageToChange').src=imageToChange;
+ }
+
+// ====================================== //
+
+
+// Exercise 3:
+
+// 3a: select "add todo" button & add click event listener to execute addTodo() function on click event
+
+document.getElementById('btn-addTodo').addEventListener('click',addTodo);
+
+// 3b: define addTodo() function, in this function:
+
+function addTodo(){
+
+ //get all lists of elements
+ var alltodoList = document.getElementById('todoList');
+ console.log(alltodoList);
+
+ //Assigning imput data to the variable
+ var todoInputvalue = document.getElementById('todoInput').value;
+ console.log(todoInputvalue);
+
+ //Creating li element
+ var newListElement = document.createElement("li");
+
+ //Assigning the new list value to the variable
+ var newListValue = document.createTextNode(todoInputvalue);
+
+ //merg the new value to the created list
+ newListElement.append(newListValue);
+
+ //Display the new element to the existing list
+ document.getElementById('todoList').appendChild(newListElement);
+
+ }
+
+// 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
\ No newline at end of file
From 5c9517d2be3d7134f33645af790179b389373272 Mon Sep 17 00:00:00 2001
From: Kelemu <50927723+kelemu-2019@users.noreply.github.com>
Date: Fri, 12 Jul 2019 13:39:23 +0200
Subject: [PATCH 02/11] Add files via upload
---
index.html | 39 +++++++++++++++++++++
index.js | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 138 insertions(+)
create mode 100644 index.html
create mode 100644 index.js
diff --git a/index.html b/index.html
new file mode 100644
index 000000000..b79c4037f
--- /dev/null
+++ b/index.html
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+ Document
+
+
+
+
Hack your future
+
+
JS2 - exercise 1
+
+
+
+
+
+
+
+
+
+
+
+
+
Todos:
+
+
Hack the future
+
Learn javascript
+
Take over the world
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/index.js b/index.js
new file mode 100644
index 000000000..33795afdf
--- /dev/null
+++ b/index.js
@@ -0,0 +1,99 @@
+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('Testing this function');
+}
+
+// 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(){
+ console.log("Hello Now the heading is Changed with Addeventlistner");
+
+ var header= document.querySelector('header1');
+ document.getElementById("header1").innerHTML="Kelemu";
+ header = document.getElementById("header1").innerHTML;
+}
+
+document.getElementById("headerChenger").addEventListener('click',changeHeader);
+
+// 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
+
+document.getElementById('btn-changeImage'). addEventListener('click',changeImage);
+
+// 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
+function changeImage(){
+ console.log('Im in the changeImage function');
+ var imageInputValue = document.getElementById('imageInput').value;
+
+ var imageToChange = document.getElementById('imageToChange').src;
+
+ imageToChange = imageInputValue
+
+ document.getElementById('imageToChange').src=imageToChange;
+ }
+
+// ====================================== //
+
+
+// Exercise 3:
+
+// 3a: select "add todo" button & add click event listener to execute addTodo() function on click event
+
+document.getElementById('btn-addTodo').addEventListener('click',addTodo);
+
+// 3b: define addTodo() function, in this function:
+
+function addTodo(){
+
+ //get all lists of elements
+ var alltodoList = document.getElementById('todoList');
+ console.log(alltodoList);
+
+ //Assigning imput data to the variable
+ var todoInputvalue = document.getElementById('todoInput').value;
+ console.log(todoInputvalue);
+
+ //Creating li element
+ var newListElement = document.createElement("li");
+
+ //Assigning the new list value to the variable
+ var newListValue = document.createTextNode(todoInputvalue);
+
+ //merg the new value to the created list
+ newListElement.append(newListValue);
+
+ //Display the new element to the existing list
+ document.getElementById('todoList').appendChild(newListElement);
+
+ }
+
+// 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
\ No newline at end of file
From 85c2b2c80bb0fb92b17fc5c5e923749f7023f17b Mon Sep 17 00:00:00 2001
From: Kelemu <50927723+kelemu-2019@users.noreply.github.com>
Date: Fri, 12 Jul 2019 13:41:24 +0200
Subject: [PATCH 03/11] Exercise
---
Week1/exercise/w1/index.html | 5 ++--
Week1/exercise/w1/index.js | 53 ++++++++++++++++++++++++++++++++++--
2 files changed, 54 insertions(+), 4 deletions(-)
diff --git a/Week1/exercise/w1/index.html b/Week1/exercise/w1/index.html
index 5a88074db..b79c4037f 100644
--- a/Week1/exercise/w1/index.html
+++ b/Week1/exercise/w1/index.html
@@ -8,7 +8,8 @@
-