Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function attachEvents() {
- let location = document.getElementById('location');
- let submitBtn = document.getElementById('submit');
- let forecast = document.getElementById('forecast')
- let url = 'http://localhost:3030/jsonstore/forecaster/locations'
- submitBtn.addEventListener('click', async function () {
- const response = await fetch(url);
- let data = await response.json();
- forecast.style.display = 'block';
- })
- }
- attachEvents();
Advertisement
Add Comment
Please, Sign In to add comment