diff --git a/components-2/Exercise 9.html b/components-2/Exercise 9.html new file mode 100644 index 00000000..2514f758 --- /dev/null +++ b/components-2/Exercise 9.html @@ -0,0 +1,14 @@ + + + +Exercise 9 + + + + +

Random Joke Generator

+
+

List of Jokes available at jsSCript.js

+
+ + \ No newline at end of file diff --git a/components-2/file.css b/components-2/file.css new file mode 100644 index 00000000..b626078d --- /dev/null +++ b/components-2/file.css @@ -0,0 +1,23 @@ +body { +text-align: center; +display: flex; +align-items: center; +background-color: silver; +} + +p { +size: 16px; +font-style: italic; +} + +li { +text-align: : center; +display: flex; +align-items: center; +} + + + + + + diff --git a/components-2/joke generator.js b/components-2/joke generator.js new file mode 100644 index 00000000..56973e1b --- /dev/null +++ b/components-2/joke generator.js @@ -0,0 +1,3 @@ +var jokes= ["Joke1", "Joke2", "Joke3", "Joke4", "Joke5"]; +function random = Math.floor(Math.random() * months.length); +console.log(random, months[random]); diff --git a/components-2/jsScript.js b/components-2/jsScript.js new file mode 100644 index 00000000..1a0c7ab5 --- /dev/null +++ b/components-2/jsScript.js @@ -0,0 +1,15 @@ +async function getJoke() { + fetch("https://icanhazdadjoke.com/", { + headers: { + Accept: "application/json", + }, + }).then((data) => { + console.log(data.json()); + }); + console.log(response, "<---- should see response"); + +function random = Math.floor(Math.random() * months.length); +console.log(random, months[random]); +document.getElementById("joke")text.Content=data.joke(); +Button.addEventListener("click",getJoke); + } \ No newline at end of file diff --git a/components-2/readme.md b/components-2/readme.md index 76d8a9aa..5337dd9b 100644 --- a/components-2/readme.md +++ b/components-2/readme.md @@ -145,7 +145,7 @@ Don't open PRs to main. If you do open a PR to main and it is merged then it wou -### Visualise this Git workflow +### Visualize this Git workflow ```mermaid gitGraph