v.1.2
This commit is contained in:
+1
-1
@@ -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>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user