I'm trying to enable a button in JavaScript as long as the user enter a text . What is wrong with this code?is it because of the using fieldset?
function setText() {
var x = document.getElementById("mail").value;
if (x != "") {
document.getElementById("btn").disabled = 'false';
}
}
<form>
<fieldset id="file1">
<legend><img src="fb-login.png" height="70" width="70" /> :</legend>
Email: <input id="mail" type="email" onchange="setText()"><br> password: <input type="password"><br><br>
<input type="submit" id="btn" value="ok" disabled> <br>
</fieldset>
</form>