I have a script that shows an element when a radio button is pressed. I'm trying to fade in the showing of the element so it's not so abrupt.
The JS:
document.getElementById('next').style.display = 'block';
document.getElementById('next').fadeIn(1000);
This works fine except for the fade in animation. What am I doing wrong. I have tried combining both statements into one statement, and I have also tried setting the fade in before the display:block, but it doesn't show up at all. Still fairly new to JS, so I'm just trying to figure out what is possible. Thanks in advance
.fadeIn()is a jQuery method (maybe in other libraries too), not a JavaScript element method. You didn't tag the question with jQuery, but the way to do it with jQuery is$("#next").fadeIn(1000);. If you want to do it with pure JavaScript, you'll have to look up ways to mimic this behavior