3
I made a condition that is not respecting the content of text
.
Follows the code:
function teste() {
var elements = document.getElementsByClassName("testetxt");
if (elements.value =! null) {
elements.style.border = 'solid 1px #00FF00;';
alert("Ok");
} else if (elements.value == null){
elements.style.border = 'solid 1px #FF0000;';
alert("Preencha o campo Código");
}
}
<html>
<body>
<input class="testetxt" type="text"/>
<button onclick="teste();" style="height:20px; width:20px;"> </button>
</body>
</html
My God, forgive my stupidity !!
– Sora
rsrs td well, sometimes I spend hours trying to find the error and it was just a dot and comma
– Marcos Brinner