From 54d71e1b0c1c16cdb912ffa4383fcf8fa49dca86 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 15:24:17 +0300 Subject: [PATCH 01/21] Step1 --- javascript-basics-01/Step_1.html | 3 +++ javascript-basics-01/step_1.js | 2 ++ javascript-basics-01/step_2.js | 0 3 files changed, 5 insertions(+) create mode 100644 javascript-basics-01/step_1.js create mode 100644 javascript-basics-01/step_2.js diff --git a/javascript-basics-01/Step_1.html b/javascript-basics-01/Step_1.html index de81630..ddbd0b4 100644 --- a/javascript-basics-01/Step_1.html +++ b/javascript-basics-01/Step_1.html @@ -6,4 +6,7 @@ + diff --git a/javascript-basics-01/step_1.js b/javascript-basics-01/step_1.js new file mode 100644 index 0000000..3b4c34b --- /dev/null +++ b/javascript-basics-01/step_1.js @@ -0,0 +1,2 @@ +let name = "Moe"; +alert(name) \ No newline at end of file diff --git a/javascript-basics-01/step_2.js b/javascript-basics-01/step_2.js new file mode 100644 index 0000000..e69de29 From fe6851603324fcd355d2a5d8e9905cb9b0a7df52 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 15:40:06 +0300 Subject: [PATCH 02/21] Step-2 --- javascript-basics-01/Step_1.html | 2 +- javascript-basics-01/Step_2.html | 2 ++ javascript-basics-01/step_2.js | 4 ++++ javascript-basics-01/step_3.js | 0 4 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-01/step_3.js diff --git a/javascript-basics-01/Step_1.html b/javascript-basics-01/Step_1.html index ddbd0b4..76203f4 100644 --- a/javascript-basics-01/Step_1.html +++ b/javascript-basics-01/Step_1.html @@ -5,8 +5,8 @@ - + diff --git a/javascript-basics-01/Step_2.html b/javascript-basics-01/Step_2.html index a214720..5f68b63 100644 --- a/javascript-basics-01/Step_2.html +++ b/javascript-basics-01/Step_2.html @@ -5,5 +5,7 @@ + + diff --git a/javascript-basics-01/step_2.js b/javascript-basics-01/step_2.js index e69de29..0f5fca8 100644 --- a/javascript-basics-01/step_2.js +++ b/javascript-basics-01/step_2.js @@ -0,0 +1,4 @@ +let name = "Moe"; +let surname = "Agha"; +let city = "Beirut"; +alert("Name: "+name+"\nSurname: "+surname+"\nCity: "+city) diff --git a/javascript-basics-01/step_3.js b/javascript-basics-01/step_3.js new file mode 100644 index 0000000..e69de29 From 3fd89d9038bfec030417e629dae86a02d82f130e Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 15:55:10 +0300 Subject: [PATCH 03/21] Step-3 --- javascript-basics-01/Step_3.html | 3 +++ javascript-basics-01/step_2.js | 2 +- javascript-basics-01/step_3.js | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/javascript-basics-01/Step_3.html b/javascript-basics-01/Step_3.html index 20b2a19..c69d3f1 100644 --- a/javascript-basics-01/Step_3.html +++ b/javascript-basics-01/Step_3.html @@ -6,4 +6,7 @@ + diff --git a/javascript-basics-01/step_2.js b/javascript-basics-01/step_2.js index 0f5fca8..36ae74e 100644 --- a/javascript-basics-01/step_2.js +++ b/javascript-basics-01/step_2.js @@ -1,4 +1,4 @@ let name = "Moe"; let surname = "Agha"; let city = "Beirut"; -alert("Name: "+name+"\nSurname: "+surname+"\nCity: "+city) +alert("Name: "+name+"\nSurname: "+surname+"\nCity: "+city); diff --git a/javascript-basics-01/step_3.js b/javascript-basics-01/step_3.js index e69de29..9ccf3d1 100644 --- a/javascript-basics-01/step_3.js +++ b/javascript-basics-01/step_3.js @@ -0,0 +1,2 @@ +var name = prompt("Please enter your name: "); +alert("Hello "+name) From bee3e0cc96c50ef0e2f8bd1275e797abf6871d83 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 16:02:12 +0300 Subject: [PATCH 04/21] Step-4 --- javascript-basics-01/Step_4.html | 1 + javascript-basics-01/step_4.js | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 javascript-basics-01/step_4.js diff --git a/javascript-basics-01/Step_4.html b/javascript-basics-01/Step_4.html index 12c8942..4c98960 100644 --- a/javascript-basics-01/Step_4.html +++ b/javascript-basics-01/Step_4.html @@ -11,5 +11,6 @@ + diff --git a/javascript-basics-01/step_4.js b/javascript-basics-01/step_4.js new file mode 100644 index 0000000..dc80682 --- /dev/null +++ b/javascript-basics-01/step_4.js @@ -0,0 +1,4 @@ +var name = prompt("Please enter your name: "); +var surname = prompt("Please enter your surname: "); +var city = prompt("Please enter the name of the city you live in: "); +alert("Hello "+name+ " "+surname+ " from "+city); \ No newline at end of file From 6f911622936d8a1df56889b468996fe7d3077e59 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 16:23:25 +0300 Subject: [PATCH 05/21] Step-5 --- javascript-basics-01/Step_5.html | 3 ++- javascript-basics-01/step_5.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-01/step_5.js diff --git a/javascript-basics-01/Step_5.html b/javascript-basics-01/Step_5.html index 60479f2..f0634ce 100644 --- a/javascript-basics-01/Step_5.html +++ b/javascript-basics-01/Step_5.html @@ -8,7 +8,8 @@


- +
+ diff --git a/javascript-basics-01/step_5.js b/javascript-basics-01/step_5.js new file mode 100644 index 0000000..c7c5343 --- /dev/null +++ b/javascript-basics-01/step_5.js @@ -0,0 +1,7 @@ +function multiply(){ + +let x = document. getElementById("first_number"). value; +let y = document. getElementById("second_number"). value; +let result = (x*y); +alert(result); +} \ No newline at end of file From 58aee80ec13bd846b8aaac8538572d544da5d678 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 16:32:31 +0300 Subject: [PATCH 06/21] Step-6 --- javascript-basics-01/Step_6.html | 3 ++- javascript-basics-01/step-6.js | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-01/step-6.js diff --git a/javascript-basics-01/Step_6.html b/javascript-basics-01/Step_6.html index b019dcc..d6749df 100644 --- a/javascript-basics-01/Step_6.html +++ b/javascript-basics-01/Step_6.html @@ -8,7 +8,8 @@


- +
+ diff --git a/javascript-basics-01/step-6.js b/javascript-basics-01/step-6.js new file mode 100644 index 0000000..01aa0bc --- /dev/null +++ b/javascript-basics-01/step-6.js @@ -0,0 +1,7 @@ +function remainder(){ + + let x = document. getElementById("first_number"). value; + let y = document. getElementById("second_number"). value; + let result = (x%y); + alert(result); + } \ No newline at end of file From ece3308b5fc01c5a59ae45f6a5782ffaa4749be7 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Wed, 30 Aug 2023 16:56:44 +0300 Subject: [PATCH 07/21] Step-7 --- javascript-basics-01/Step_7.html | 3 ++- javascript-basics-01/step-7.js | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-01/step-7.js diff --git a/javascript-basics-01/Step_7.html b/javascript-basics-01/Step_7.html index 05ff583..db0b93b 100644 --- a/javascript-basics-01/Step_7.html +++ b/javascript-basics-01/Step_7.html @@ -8,7 +8,8 @@


- +
+ diff --git a/javascript-basics-01/step-7.js b/javascript-basics-01/step-7.js new file mode 100644 index 0000000..454c74c --- /dev/null +++ b/javascript-basics-01/step-7.js @@ -0,0 +1,6 @@ +function bwad(){ + let x = document.getElementById("shoe_size"). value; + let year = parseInt(document.getElementById("year").value) + let result = ((((x*2+5)*50)-year)+1766); + alert(result); + } \ No newline at end of file From 7f717e9a191c76ec86cf201d97f8f5f18029863f Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 09:27:50 +0300 Subject: [PATCH 08/21] Step-8 --- javascript-basics-01/Step_8.html | 3 ++- javascript-basics-01/step-8.js | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-01/step-8.js diff --git a/javascript-basics-01/Step_8.html b/javascript-basics-01/Step_8.html index 75804e8..604cc88 100644 --- a/javascript-basics-01/Step_8.html +++ b/javascript-basics-01/Step_8.html @@ -7,7 +7,8 @@

- +
+ diff --git a/javascript-basics-01/step-8.js b/javascript-basics-01/step-8.js new file mode 100644 index 0000000..c17b1ae --- /dev/null +++ b/javascript-basics-01/step-8.js @@ -0,0 +1,9 @@ +function CalculateAge(){ + let age = parseFloat(document.getElementById("age").value) + if(age>18){ + alert("User is over 18") + } + else + alert("User is under 18") + + } From bb82951b6f8fdbbea16522ffe1f4d5b890440ca3 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 15:00:48 +0300 Subject: [PATCH 09/21] js2-step1 --- javascript-basics-02/step 1/index.html | 1 + javascript-basics-02/step 1/js2-step1.js | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 javascript-basics-02/step 1/js2-step1.js diff --git a/javascript-basics-02/step 1/index.html b/javascript-basics-02/step 1/index.html index 5ad09a6..316038d 100644 --- a/javascript-basics-02/step 1/index.html +++ b/javascript-basics-02/step 1/index.html @@ -7,4 +7,5 @@ + diff --git a/javascript-basics-02/step 1/js2-step1.js b/javascript-basics-02/step 1/js2-step1.js new file mode 100644 index 0000000..5d692bb --- /dev/null +++ b/javascript-basics-02/step 1/js2-step1.js @@ -0,0 +1,8 @@ +let img = document.querySelector("#image1"); + +img.addEventListener("mouseover",()=> +{ + + img.setAttribute("src","images/image1_2.jpg"); +} +) From 138daaacbb0f0dbd18522054cc365357d4316622 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 15:21:47 +0300 Subject: [PATCH 10/21] js2-step2 --- javascript-basics-02/step 2/index.html | 3 ++- javascript-basics-02/step 2/js2-step2.js | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-02/step 2/js2-step2.js diff --git a/javascript-basics-02/step 2/index.html b/javascript-basics-02/step 2/index.html index cf25790..1918e82 100644 --- a/javascript-basics-02/step 2/index.html +++ b/javascript-basics-02/step 2/index.html @@ -6,7 +6,8 @@
- +
+ diff --git a/javascript-basics-02/step 2/js2-step2.js b/javascript-basics-02/step 2/js2-step2.js new file mode 100644 index 0000000..e8c0634 --- /dev/null +++ b/javascript-basics-02/step 2/js2-step2.js @@ -0,0 +1,4 @@ +function myFunction(){ + let name = document.querySelector("#name"); + alert("thank you for participating"); +} \ No newline at end of file From b989d89642c788a1fe42bbc04b2c7f9c29d00f90 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 16:31:48 +0300 Subject: [PATCH 11/21] js2-step3 --- javascript-basics-02/step 3/index.html | 5 ++++- javascript-basics-02/step 3/js2-step3.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-02/step 3/js2-step3.js diff --git a/javascript-basics-02/step 3/index.html b/javascript-basics-02/step 3/index.html index 308c0b8..b515065 100644 --- a/javascript-basics-02/step 3/index.html +++ b/javascript-basics-02/step 3/index.html @@ -6,7 +6,10 @@
- +
+ +
+ diff --git a/javascript-basics-02/step 3/js2-step3.js b/javascript-basics-02/step 3/js2-step3.js new file mode 100644 index 0000000..2879247 --- /dev/null +++ b/javascript-basics-02/step 3/js2-step3.js @@ -0,0 +1,5 @@ +function myFunction(){ + let div = document.querySelector("div"); + let name = document.querySelector("#name"); + div.innerHTML = name.value; +} \ No newline at end of file From 9c15370a39d0f8c655baaddc42adf52c6bbf1c1e Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 16:38:36 +0300 Subject: [PATCH 12/21] js2-step3 --- javascript-basics-02/step 3/index.html | 2 +- javascript-basics-02/step 4/index.html | 3 ++- javascript-basics-02/step 4/js2-step4.js | 5 +++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 javascript-basics-02/step 4/js2-step4.js diff --git a/javascript-basics-02/step 3/index.html b/javascript-basics-02/step 3/index.html index b515065..413fd1c 100644 --- a/javascript-basics-02/step 3/index.html +++ b/javascript-basics-02/step 3/index.html @@ -6,7 +6,7 @@
- +
diff --git a/javascript-basics-02/step 4/index.html b/javascript-basics-02/step 4/index.html index f5086df..8435e5f 100644 --- a/javascript-basics-02/step 4/index.html +++ b/javascript-basics-02/step 4/index.html @@ -9,7 +9,8 @@ - + + diff --git a/javascript-basics-02/step 4/js2-step4.js b/javascript-basics-02/step 4/js2-step4.js new file mode 100644 index 0000000..9af314a --- /dev/null +++ b/javascript-basics-02/step 4/js2-step4.js @@ -0,0 +1,5 @@ +function myFunction(){ + let = document.("div"); + let name = document.querySelector("#name"); + div.innerHTML = name.value; +} \ No newline at end of file From ac9eaeb02ea938670ccd55b4a3bdb073683029e2 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Thu, 31 Aug 2023 16:58:38 +0300 Subject: [PATCH 13/21] js2-step4 --- javascript-basics-02/step 4/index.html | 2 +- javascript-basics-02/step 4/js2-step4.js | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/javascript-basics-02/step 4/index.html b/javascript-basics-02/step 4/index.html index 8435e5f..5f479ab 100644 --- a/javascript-basics-02/step 4/index.html +++ b/javascript-basics-02/step 4/index.html @@ -9,7 +9,7 @@ - + diff --git a/javascript-basics-02/step 4/js2-step4.js b/javascript-basics-02/step 4/js2-step4.js index 9af314a..0fa0a47 100644 --- a/javascript-basics-02/step 4/js2-step4.js +++ b/javascript-basics-02/step 4/js2-step4.js @@ -1,5 +1,16 @@ function myFunction(){ - let = document.("div"); - let name = document.querySelector("#name"); - div.innerHTML = name.value; + let confirm = prompt("do you really wanna reset?"); + let name = document.getElementById("name"); + let surname = document.getElementById("surname"); + let city = document.getElementById("city"); + + if(confirm == 'y' || confirm == 'Y'){ + name.value = "" + surname.value=""; + city.value=""; + + + + + } } \ No newline at end of file From 39bcfbf285e311154983f34c428d580da6de27e8 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 14:40:16 +0300 Subject: [PATCH 14/21] js2-step5 --- javascript-basics-02/step 5/index.html | 11 ++++++----- javascript-basics-02/step 5/js2-step5.js | 13 +++++++++++++ 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 javascript-basics-02/step 5/js2-step5.js diff --git a/javascript-basics-02/step 5/index.html b/javascript-basics-02/step 5/index.html index fe14eb9..6283394 100644 --- a/javascript-basics-02/step 5/index.html +++ b/javascript-basics-02/step 5/index.html @@ -6,11 +6,12 @@
- - - - - + + + + +
+ diff --git a/javascript-basics-02/step 5/js2-step5.js b/javascript-basics-02/step 5/js2-step5.js new file mode 100644 index 0000000..71d8f35 --- /dev/null +++ b/javascript-basics-02/step 5/js2-step5.js @@ -0,0 +1,13 @@ +var img1 = document.getElementById("image1"); +var img2 = document.getElementById("image2"); +var img3 = document.getElementById("image3"); +var img4 = document.getElementById("image4"); +var img5 = document.getElementById("image5"); + +function agha(){ +img1.src = 'images/image1_2.jpg'; +img2.src = 'images/image2_2.jpg'; +img3.src = 'images/image3_2.jpg'; +img4.src = 'images/image4_2.jpg'; +img5.src = 'images/image5_2.jpg' +} From fd1f022bea479618f0f0c77d59ec2dae77dd8407 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 14:47:02 +0300 Subject: [PATCH 15/21] js2-step6 --- javascript-basics-02/step 6/index.html | 11 ++++++----- javascript-basics-02/step 6/js2-step6.js | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 javascript-basics-02/step 6/js2-step6.js diff --git a/javascript-basics-02/step 6/index.html b/javascript-basics-02/step 6/index.html index 2eecf4f..a05529c 100644 --- a/javascript-basics-02/step 6/index.html +++ b/javascript-basics-02/step 6/index.html @@ -5,10 +5,11 @@ Step 6 - - - - - + + + + + + diff --git a/javascript-basics-02/step 6/js2-step6.js b/javascript-basics-02/step 6/js2-step6.js new file mode 100644 index 0000000..2cc60fe --- /dev/null +++ b/javascript-basics-02/step 6/js2-step6.js @@ -0,0 +1,22 @@ +var img1 = document.getElementById("image1"); +var img2 = document.getElementById("image2"); +var img3 = document.getElementById("image3"); +var img4 = document.getElementById("image4"); +var img5 = document.getElementById("image5"); + +function hover(){ +img1.src = 'images/image1_2.jpg'; +img2.src = 'images/image2_2.jpg'; +img3.src = 'images/image3_2.jpg'; +img4.src = 'images/image4_2.jpg'; +img5.src = 'images/image5_2.jpg' +} + +function leave(){ + img1.src = 'images/image1.jpg'; + img2.src = 'images/image2.jpg'; + img3.src = 'images/image3.jpg'; + img4.src = 'images/image4.jpg'; + img5.src = 'images/image5.jpg' + +} \ No newline at end of file From fe9c9dee5d89fab5cedaa50fbbdd773babfb4c09 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 15:57:43 +0300 Subject: [PATCH 16/21] js3-step1 --- javascript-basics-03/step 1/index.html | 3 ++- javascript-basics-03/step 1/js3-step1.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 javascript-basics-03/step 1/js3-step1.js diff --git a/javascript-basics-03/step 1/index.html b/javascript-basics-03/step 1/index.html index eb4909d..6a27b1d 100644 --- a/javascript-basics-03/step 1/index.html +++ b/javascript-basics-03/step 1/index.html @@ -5,6 +5,7 @@ Step 1 - + + diff --git a/javascript-basics-03/step 1/js3-step1.js b/javascript-basics-03/step 1/js3-step1.js new file mode 100644 index 0000000..c7d7906 --- /dev/null +++ b/javascript-basics-03/step 1/js3-step1.js @@ -0,0 +1,5 @@ +let img = document.querySelector("#image1"); +function hover(){ + img.style.border = "3px solid red"; + +} From 700b9ab10109a8d856478936134f5796957bf731 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 16:34:56 +0300 Subject: [PATCH 17/21] js3-step2 --- javascript-basics-03/step 2/index.html | 5 +++-- javascript-basics-03/step 2/js3-step2.js | 13 +++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 javascript-basics-03/step 2/js3-step2.js diff --git a/javascript-basics-03/step 2/index.html b/javascript-basics-03/step 2/index.html index aeff7fa..e759c73 100644 --- a/javascript-basics-03/step 2/index.html +++ b/javascript-basics-03/step 2/index.html @@ -5,10 +5,11 @@ Step 2 -Show -Hide +Show +Hide

Joseph Dacre Carlyle (Carlisle, 4 juin 1758 - Newcastle upon Tyne, 12 avril 1804) est un orientaliste anglais.Après ses études à l'université de Cambridge, il y devint professeur d'arabe. En 1799, il fut attaché par le gouvernement britannique à l'ambassade de Lord Elgin dans l'Empire ottoman. Il était chargé d'explorer les bibliothèques de la région (principalement celle du Sérail) pour y découvrir (et y acquérir) des manuscrits inédits de textes antiques. Il se rendit aussi en Égypte, en Terre sainte et au mont Athos. Sa mission fut, de son point de vue, un échec. Il acheta quelques centaines d'ouvrages, principalement dans les bazars de Constantinople, mais aucun ne contenait de texte inédit. Cependant, la façon dont certains manuscrits avaient été acquis, principalement ceux du patriarche de Jérusalem Anthème Ier, ainsi que la querelle entamée sur la plaine de Troie entre Carlyle et un autre professeur de Cambridge, Edward Daniel Clarke, allaient être utilisées, après la mort de Carlyle, contre Lord Elgin, dans les controverses autour de l'acquisition des « marbres d'Elgin ».De retour en Grande-Bretagne à l'automne 1801, Joseph Dacre Carlyle entama une traduction en arabe de la Bible. Sa mort en avril 1804 coupa court à ce travail.

+ diff --git a/javascript-basics-03/step 2/js3-step2.js b/javascript-basics-03/step 2/js3-step2.js new file mode 100644 index 0000000..8352263 --- /dev/null +++ b/javascript-basics-03/step 2/js3-step2.js @@ -0,0 +1,13 @@ +document.addEventListener('DOMContentLoaded', function(){ + let show = document.getElementById('show'); + let hide = document.getElementById('hide'); + let text = document.getElementById('texte'); + + show.addEventListener('click',function(){ + text.style.display="block"; + }) + + hide.addEventListener('click',function(){ + text.style.display="none"; +}) +}) \ No newline at end of file From 6a87bafd5a3f78764e950b31fb9669160280262e Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 16:58:28 +0300 Subject: [PATCH 18/21] js3-step3 --- javascript-basics-03/step 3/index.html | 1 + javascript-basics-03/step 3/js3-step3.js | 30 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 javascript-basics-03/step 3/js3-step3.js diff --git a/javascript-basics-03/step 3/index.html b/javascript-basics-03/step 3/index.html index 0db3888..856ff67 100644 --- a/javascript-basics-03/step 3/index.html +++ b/javascript-basics-03/step 3/index.html @@ -14,5 +14,6 @@
+ diff --git a/javascript-basics-03/step 3/js3-step3.js b/javascript-basics-03/step 3/js3-step3.js new file mode 100644 index 0000000..ae9971f --- /dev/null +++ b/javascript-basics-03/step 3/js3-step3.js @@ -0,0 +1,30 @@ +// document.addEventListener('DOMContentLoaded', function(){ + // let green = document.getElementsByClassName('color green'); + // let red = document.getElementsByClassName('color red'); + // let blue = document.getElementsByClassName('color blue'); + +// show.addEventListener('click',function(){ +// green.style.display="block"; +// }) + +// show.addEventListener('click',function(){ +// red.style.display="block"; +// }) +// show.addEventListener('click',function(){ +// blue.style.display="block"; +// }) +// }) +let green = document.querySelector('.green'); +let red = document.querySelector('.red'); +let blue = document.querySelector('.blue'); +let text = document.getElementById('text'); + red.addEventListener("click",function(){ + text.style.color = 'red'; + }) + green.addEventListener("click",function(){ + text.style.color = 'green'; + }) + blue.addEventListener("click",function(){ + text.style.color = 'blue'; + }) + From ffe0bf0bf0e11bf92b66c90e3f1e28b049a67a83 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 22:44:04 +0300 Subject: [PATCH 19/21] js3-step4 --- javascript-basics-02/step 4/js2-step4.js | 4 ---- javascript-basics-03/step 4/index.html | 3 ++- javascript-basics-03/step 4/js3-step4.js | 12 ++++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 javascript-basics-03/step 4/js3-step4.js diff --git a/javascript-basics-02/step 4/js2-step4.js b/javascript-basics-02/step 4/js2-step4.js index 0fa0a47..fabb99b 100644 --- a/javascript-basics-02/step 4/js2-step4.js +++ b/javascript-basics-02/step 4/js2-step4.js @@ -8,9 +8,5 @@ function myFunction(){ name.value = "" surname.value=""; city.value=""; - - - - } } \ No newline at end of file diff --git a/javascript-basics-03/step 4/index.html b/javascript-basics-03/step 4/index.html index cab276b..ba6f32a 100644 --- a/javascript-basics-03/step 4/index.html +++ b/javascript-basics-03/step 4/index.html @@ -8,7 +8,8 @@
- +
+ diff --git a/javascript-basics-03/step 4/js3-step4.js b/javascript-basics-03/step 4/js3-step4.js new file mode 100644 index 0000000..db8a2b2 --- /dev/null +++ b/javascript-basics-03/step 4/js3-step4.js @@ -0,0 +1,12 @@ +let pass = document.getElementById("password") +let confirm = document.getElementById("confirmation") +function checkPass(){ + if (pass.value != confirm.value){ + pass.style.border = "3px solid red"; + confirm.style.border = "3px solid red"; + } + else{ + pass.style.border = "1px solid black"; + confirm.style.border = "1px solid black" + } +} \ No newline at end of file From e8276c020d9d3a5f8bc29a5e64f453454bec4f0e Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 23:57:02 +0300 Subject: [PATCH 20/21] reached createLanguagesArray function --- javascript-basics-04-tdd/questions.js | 79 +++++++-------------------- 1 file changed, 20 insertions(+), 59 deletions(-) diff --git a/javascript-basics-04-tdd/questions.js b/javascript-basics-04-tdd/questions.js index d56a923..e329be9 100644 --- a/javascript-basics-04-tdd/questions.js +++ b/javascript-basics-04-tdd/questions.js @@ -1,101 +1,62 @@ const stringSize = (text) => { - + return text.length; } const replaceCharacterE = (text) => { - + return text.replace('e',' '); } const concatString = (text1, text2) => { - + return text1+text2; } const showChar5 = (text) => { - + return text.charAt(4); } const showChar9 = (text) => { - + return text.substring(0,9); } const toCapitals = (text) => { - + return text.toUpperCase(); } const toLowerCase = (text) => { - + return text.toLowerCase(); } const removeSpaces = (text) => { - + return text.trim(); } const IsString = (text) => { - + return (text.IsString = true ) } const getExtension = (text) => { - + return text.split(".").pop(); } const countSpaces = (text) => { - + return text.split(" ").length -1; } const InverseString = (text) => { - + return text.split("").reverse().join(""); } const power = (x, y) => { - + return Math.pow(x, y); } const absoluteValue = (num) => { - + return Math.abs(num); } const absoluteValueArray = (array) => { - + return array.map(Math.abs); } const circleSurface = (radius) => { - + return Math.round(Math.PI * radius * radius); } const hypothenuse = (ab, ac) => { - + return Math.hypot(ab, ac); } const BMI = (weight, height) => { - + return parseFloat((weight / (height * height)).toFixed(2)); } const createLanguagesArray = () => { - -} - -const createNumbersArray = () => { - -} - -const replaceElement = (languages) => { - -} - -const addElement = (languages) => { - -} - -const addNumberElement = (numbers) => { - -} - -const removeFirst = (languages) => { - -} - -const removeLast = (languages) => { - -} - -const convertStrToArr = (social_arr) => { - -} - -const convertArrToStr = (languages) => { - -} - -const sortArr = (social_arr) => { - -} - -const invertArr = (social_arr) => { - + const languages = ["Html", "CSS", "Java", "PHP"]; + return languages; } \ No newline at end of file From ce91fa06ae0d5c53dedaf6ae27ea0d8b1ffdc7a5 Mon Sep 17 00:00:00 2001 From: AghaDev Date: Fri, 1 Sep 2023 23:59:09 +0300 Subject: [PATCH 21/21] continued the remaining --- javascript-basics-04-tdd/questions.js | 50 +++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/javascript-basics-04-tdd/questions.js b/javascript-basics-04-tdd/questions.js index e329be9..0b983b7 100644 --- a/javascript-basics-04-tdd/questions.js +++ b/javascript-basics-04-tdd/questions.js @@ -59,4 +59,54 @@ const BMI = (weight, height) => { const createLanguagesArray = () => { const languages = ["Html", "CSS", "Java", "PHP"]; return languages; +} + +const createNumbersArray = () => { + const numArray = [0, 1, 2, 3, 4, 5]; + return numArray; +} + +const replaceElement = (languages) => { + languages[2] = "Javascript"; + return languages; +} + +const addElement = (languages) => { + languages.push("Ruby", "Python"); + return languages; +} + +const addNumberElement = (numbers) => { + numbers.unshift(-2, -1); + return numbers; +} + +const removeFirst = (languages) => { + languages.shift(); + return languages; +} + +const removeLast = (languages) => { + languages.pop(); + return languages; +} + +const convertStrToArr = (social_arr) => { + const tableau = social_arr.split(","); + return tableau; +} + +const convertArrToStr = (languages) => { + const str = languages.join(); + return str; +} + +const sortArr = (social_arr) => { + social_arr.sort(); + return social_arr; +} + +const invertArr = (social_arr) => { + social_arr.reverse(); + return social_arr; } \ No newline at end of file