Skip to content

Commit

Permalink
Added enter keypress event as trigger for calculation button
Browse files Browse the repository at this point in the history
  • Loading branch information
maxrugen committed Nov 22, 2023
1 parent f693538 commit 4fa676a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion script.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,10 @@ function convertTime() {
}
}
}
}
}
// Add event listener for the Enter key on the input field
document.getElementById("timeInput").addEventListener("keypress", function (event) {
if (event.key === "Enter") {
convertTime();
}
});

0 comments on commit 4fa676a

Please sign in to comment.