If I have this HTML
<img src="aaa.png" id="a" style="filter: alpha(opacity=100)"/>
Then this javascript works in IE6
document.getElementById("a").filters.alpha.opacity = 60;
But if the style is not set
<img src="aaa.png" id="a" style=""/>
javascript throws error "filters.alpha" is null or not an object
This code works
document.getElementById("a").style.filter = "alpha(opacity=60)";
But then other filters applied to the image are overwritten. So the question is: how to add an alpha filter to any HTML element and save other filters in IE?
edit I would like to use a pure javascript (not jQuery) solution
javascript css internet-explorer
Jan TuroΕ
source share