I want to disable the submit button if the text area is empty. I have initialized the submit button to disable condition and written bellow codes. But after typing text inside text area, it not got enable condition. Below are the codes. I have tried with If…else…condition also
<form id="breakdown">
<textarea id="tbd" placeholder="Enter breakdown details"></textarea>
<br>
<input type="submit" id="btn10" value="submit" disabled>
</form>
function disableEnableSubmitButton () {
let textarea1 = document.getElementById("tbd").value;
textarea1.addEventListener("input",change);
}
function change () {
document.getElementById("btn10").disabled = false;
}