-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
24 lines (22 loc) · 720 Bytes
/
script.js
File metadata and controls
24 lines (22 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const qoutesEl = document.getElementById('qoutes');
const btnEl = document.getElementById('qoute-btn');
const idNumber = document.getElementById('idNo');
//let qoute = "";
const generateqoute = async () => {
const result = await fetch('https://api.adviceslip.com/advice');
const data = await result.json();
qoutesEl.innerText = data.slip.advice;
idNumber.innerText = data.slip.id;
};
// function generateqoute() {
// fetch("https://api.adviceslip.com/advice")
// .then((result) => {
// return result.json();
// })
// .then((data) => {
// qoute = data.slip.advice;
// qoutesEl.innerText = qoute;
// });
// }
//btnEl.addEventListener("click", generateqoute);
generateqoute();