What's wrong? I need this effect to validate form.
var input = document.getElementByClass("dado");
input.style.border = "1px solid red";
What's wrong? I need this effect to validate form.
var input = document.getElementByClass("dado");
input.style.border = "1px solid red";
You're using the wrong getElementsByClassName . And the return is an array, so it should be accessed by the index:
var input = document.getElementsByClassName("dado");
input[0].style.border = "2px solid red";
<input class="dado" />