From d69b4a998609710b1639c7729c187aa02f048e28 Mon Sep 17 00:00:00 2001 From: terratamo Date: Tue, 1 Oct 2019 19:24:46 -0400 Subject: [PATCH] week10practice --- index.html | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ script.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) create mode 100644 index.html create mode 100644 script.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..7e5bc3a --- /dev/null +++ b/index.html @@ -0,0 +1,51 @@ + + + + Hello! + + + + + + + + + + +

Hi there!

+
+ +

question 1, Counter

+ + +

Clicks: 0

+
+ +
+ +

question 2, Alert

+ + + +
+ + +
+

+ question 3, type info and clear it +

+
+ Name: + Lastname:

+ +
+
+ + + + + + + + + diff --git a/script.js b/script.js new file mode 100644 index 0000000..363a5dc --- /dev/null +++ b/script.js @@ -0,0 +1,51 @@ +// problem 1 = the function dosent understand what to do if you dont define it's mission. +var animal = "dogs" + +function smallAnimals(){ + var bigAnimal = animal + " are cute" + + return bigAnimal; +} + +smallAnimals(); + + +//problem 2 = + +var clicks = 0; +function onClick() { + clicks += 1; + document.getElementById("clicks").textContent = clicks; +}; + +//problem 3 = + +function glass(){ + + alert("the user has clicked"); + +} + +//problem 4 = + +function clearinfo (){ + document.querySelector("forms").reset(); + +} + +//problem 5 = + +const addalert = function newf(paramet) { + document.getElementById("demo").innerHTML = paramet; +} + + +try { +addalert("Welcome guest!"); +} +catch(err) { +document.getElementById("demo").innerHTML = err.message; +} + + +