I have one form with 2 submit buttons, and for each one I want to add a different event listener on click, and perform a different action for each one. But the second one is not working, the function does not fire. I am new on JS so any help will be welcome. Thanks in advance. My code is: HTML
<form id="searching" action="javascript:void(0);">
<input class="form-class w-50" type="text" id="search" placeholder="Input your search keyword" name="search">
<br><br>
<input type="submit" class="btn btn-warning" id="submit" value="Weather" name="weather">
<input type="submit" class="btn btn-warning" id="submit2" value="Forecast!" name="forecast">
</form>
JS
const submit = document.getElementById('submit');
submit.addEventListener('click', event.getSearch.bind(this,'search'));
const submit2 = document.getElementById('submit2');
submit2.addEventListener('click', event.getForecast.bind(this));