1function removeFadeOut( el, speed ) {
2 var seconds = speed/1000;
3 el.style.transition = "opacity "+seconds+"s ease";
4
5 el.style.opacity = 0;
6 setTimeout(function() {
7 el.parentNode.removeChild(el);
8 }, speed);
9}
10
11removeFadeOut(document.getElementById('test'), 2000);
12