button add eventlistenter on buttin click code example
Example: javascript onclick event listener
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});
document.getElementById("myBtn").addEventListener("click", function() {
alert("Hello World!");
});