0
What’s wrong? I need this effect to validate form.
var input = document.getElementByClass("dado");
input.style.border = "1px solid red";
0
What’s wrong? I need this effect to validate form.
var input = document.getElementByClass("dado");
input.style.border = "1px solid red";
3
You’re using the wrong getElementsByClassName. And the return is an array, so it must be accessed by the index:
var input = document.getElementsByClassName("dado");
input[0].style.border = "2px solid red";
<input class="dado" />
Browser other questions tagged javascript html5 css3
You are not signed in. Login or sign up in order to post.