I'm trying to use change the opacity of a class that is passed into the function parameter as element. It seems to crash as it reaches "target.style.opacity = newSetting"
I'm not sure what is causing this issue because when I use a getElementById instead it works.

here's the Javascript

```
var fade_out_from = 10;
function fadeOut(element)
{
    moving = true;
    var target = document.getElementsByClassName(element);
    var newSetting = fade_out_from / 10;
    target.style.opacity = newSetting;
    fade_out_from--;
    if(fade_out_from == 0){
        target.style.opacity = 0;
        target.style.display = "none";
        clearTimeout(loopTimer);
        fade_out_from = 10;
        moving = false;
        return false;
    }
    var loopTimer = setTimeout(fadeOut(element),10);
}

```