I would like the "Send" button to be disabled if the input is empty. I want to manage this in the JavaScript file. I know that it is possible in HTML to call a function on the input but I prefer to use an event in the js file.
https://codepen.io/leakcim-web/pen/gOYPpqo
//javascript
let inputElt = document.getElementById('input');
let btn = document.getElementById('button');
if (inputElt.value !== '') {
btn.disabled = false;
} else {
btn.disabled = true;
}
<input placeholder="Enter some text" name="name" id='input' />
<button id='button'>Réserver</button>