This commit is contained in:
2021-12-07 19:35:53 -06:00
parent ef32350930
commit 8f20d19af6
2 changed files with 11 additions and 1 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
<body onload="onload()">
Code:<br>
<input type="text" id="input">
<button value="Submit" onclick="lookup()">Submit</button><br><br><hr>
<button value="Submit" onclick="lookup()" id="button">Submit</button><br><br><hr>
<h1 style="text-decoration: none;">Result:</h1>
<b>ICAO: </b> <span id="icao"></span><br>
<b>IATA: </b> <span id="iata"></span><br>
+10
View File
@@ -45,6 +45,16 @@ function onload() {
}
}
xhr.send();
var box = document.getElementById("input")
box.addEventListener("keyup", function (event) {
// Checking if key pressed is ENTER or not
// if the key pressed is ENTER
// click listener on button is called
if (event.keyCode == 13) {
document.getElementById("button").click();
}
})
}
function clear() {