<button type="button" id="eventButton">Button for
event</button>
var eventButton = document.getElementById("eventButton");
var eventFunction = (event) =>{
//You can edit this code by clicking here
alert("event triggered from Button")
}
eventButton.addEventListener("
", eventFunction);
<input type="text" id="eventInputBox">
var eventInputBox =
document.getElementById("eventInputBox");
var eventInputFunction = (event) =>{
//You can edit this code by clicking here
alert("event triggered from Input Box")
}
eventInputBox.addEventListener("
", eventInputFunction);