-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
executable file
·29 lines (21 loc) · 843 Bytes
/
script.js
File metadata and controls
executable file
·29 lines (21 loc) · 843 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
25
26
27
document.getElementById("weatherSubmit").addEventListener("click", function(event) {
event.preventDefault();
const value = document.getElementById("animeTypes").value;
console.log(value);
const url = "https://api.waifu.pics/sfw/" + value;
fetch(url)
.then(function(response) {
return response.json();
}).then(function(json) {
console.log(json);
let results = "";
results += json.url;
document.getElementById("weatherResults").src = results;;
var searchBox = document.getElementById("animeTypes");
searchBox.style.marginTop = "5%";
searchBox.style.marginBottom = "10px";
var submitBox = document.getElementById("weatherSubmit");
submitBox.style.marginTop = "5%";
submitBox.style.marginBottom = "10px";
});
});