-4
if ($("#nome").val() === ""){
$("#nome::placeholder").css("color", "red");
$("#nome").focus();
return false;
}
My goal is set the color of placeholder for red if the name field is emptiness
I followed that example
http://jsfiddle.net/erackson/9kaHw/2/
But it didn’t work.
Where am I going wrong?
Note: The phocus works but the placeholder doesn’t stay red
Dude, but if the field isn’t empty like you want the placeholder to appear, if you type a . which is in the input the placeholde already goes away...
– hugocsl
This answers your question? Change the "placeholder" color without affecting the "value" color"
– Woss
in the case is when you submit the form that the check is done. In the form of the reply I posted, solves the problem!
– Carlos Rocha