I am new to javascript and jquery.
I have written some javascript code for some client validation.
document.getElementById(spnError).style.display = 'block';
This is how I am showing a span if there is some validation issues in the form. I want to use Jquery to show this span. I would like to slide it down slowly.
Since you’re using a variable for the ID, you need the
#IDselector and.slideDown(), like this:without the
#ifspnErroris say"mySpanElement", it’s looking for that tag name,<mySpanElement>…to search by ID prepend a#to it 🙂You can read more about jQuery selectors here and view a complete list here.