Age
+--
+Gender
+--
+Probability: --
+Nationality
+--
Probability: --
+diff --git a/Sujan Karmakar/Dog Images/app.js b/Sujan Karmakar/Dog Images/app.js new file mode 100644 index 00000000..29df9971 --- /dev/null +++ b/Sujan Karmakar/Dog Images/app.js @@ -0,0 +1,19 @@ +let btn = document.querySelector("button"); +let box = document.querySelector(".content-container"); + +let url = "https://dog.ceo/api/breeds/image/random"; + +async function getImage() { + try { + let res = await axios.get(url); + return res.data.message; + } catch (err) { + return (`Error : ${err}`); + } +} + +btn.addEventListener("click", async () => { + box.style.backgroundImage = `url(${await getImage()})`; + box.style.backgroundSize = "cover"; + box.style.backgroundRepeat = "no-repeat"; +}); \ No newline at end of file diff --git a/Sujan Karmakar/Dog Images/index.html b/Sujan Karmakar/Dog Images/index.html new file mode 100644 index 00000000..43cb0392 --- /dev/null +++ b/Sujan Karmakar/Dog Images/index.html @@ -0,0 +1,68 @@ + + + +
+ + +--
+--
+Probability: --
+--
Probability: --
+