i would like to create the span class error, and fade it
if(formName == ”) {
$("#name").after('<span class="error"> Put your name please</span>');
$(".error").fadeIn("slow");
hasError = true;
}
What is missing me here ?
Thanks
Your problem is that you create the span and it’s already shown when you create it. Try hiding it and then fading it in:
This may not produce a desirable result if you have multiple elements with the class
error, however. To fix that, try something like this: