diff --git a/Rahul Kumar/app.js b/Rahul Kumar/app.js new file mode 100644 index 00000000..0e2b9024 --- /dev/null +++ b/Rahul Kumar/app.js @@ -0,0 +1,11 @@ +let para = document.querySelector('#paragraph2'); +let btn = document.querySelector('button'); +let para2 = document.querySelector('#paragraph'); + +async function getJokes(){ + let res = await fetch("https://official-joke-api.appspot.com/random_joke"); + let data = await res.json(); + console.log(data); + para.innerHTML = `setup: ${data.punchline}` + para2.innerHTML = `punchline: ${data.setup}` +} \ No newline at end of file diff --git a/Rahul Kumar/index.html b/Rahul Kumar/index.html new file mode 100644 index 00000000..1c7682dd --- /dev/null +++ b/Rahul Kumar/index.html @@ -0,0 +1,18 @@ + + + + + + Daily Jokes🤣 + + + +
+

Get Random Jokes from an API

+ +

setup:

+

punchline:

+
+ + + diff --git a/Rahul Kumar/style.css b/Rahul Kumar/style.css new file mode 100644 index 00000000..f0c790c4 --- /dev/null +++ b/Rahul Kumar/style.css @@ -0,0 +1,17 @@ +div{ + text-align: center; + color: blueviolet; + font-family: monospace; +} +h2{ + color: brown; + text-decoration: underline; +} +button{ + padding: 10px 20px; + background-color: rgb(163, 15, 163); + color: white; + font-weight: bold; + border: none; + border-radius: 7px; +} \ No newline at end of file