Write a JS program that retries arrival times for all buses by given bus stop ID when a button is clicked. Use the following HTML template to test your code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bus Stop</title>
<style>
#stopName {
font-size: 1.5em;
font-weight: 400;
padding: 0.25em;
background-color: aquamarine;
}
</style>
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
</head>
<body>
<div id="stopInfo" style="width:20em">
<div>
<label for="stopId">Stop ID: </label>
<input id="stopId" type="text">
<input id="submit" type="button" value="Check" onclick="getInfo()"></div>
<div id="result">
<div id="stopName"></div>
<ul id="buses"></ul>
</div>
</div>
<script>
function getInfo() {
// TODO ...
}
</script>
</body>
</html>
When the button with ID 'submit' is clicked, the name of the bus stop appears and the list bellow gets populated with all the buses that are expected and their time of arrival. Take the value of the input field with id 'stopId'. Submit a GET request to https://judgetests.firebaseio.com/businfo/{stopId}.json (replace the highlighted part with the correct value) and parse the response. You will receive a JSON object in format:
stopId: {
name: stopName,
buses: { busId: time, … }
}
Place the name property as text inside the div with ID 'stopName' and each bus as a list item with text:
"Bus {busId} arrives in {time}"
Replace all highlighted parts with the relevant value from the response. If the request is not successful, or the information is not in the expected format, display "Error" as stopName and nothing in the list. The list should be cleared before every request is sent.
The webhost will respond with valid data to IDs 1287, 1308, 1327 and 2334.
Examples:

When the button is clicked, the results are displayed in the corresponding elements:

If an error occurs, the stop name changes to Error:
