<button onclick="opacity(this, 2000)">click</button>
<script>
function opacity(element, speed){
var op = 100;
setInterval(function(){
if(!element.style.opacity){
element.style.opacity = 1;
}
if(!element.style.filter){
element.style.filter = 'alpha(opacity = 100)';
}
element.style.opacity -= 0.08;
element.style.filter = 'alpha(opacity =' + op + ')';
op = op - 8;// Как присвоить минус?
}, speed / 30)
}
</script>