0

I thought this would be simple I am trying tochange the opacity using style. but keeps throwing an error

document.getElementById('overlay').style.background='#000';
document.getElementById('overlay').style.opacity='40';
document.getElementById('overlay').style.filter='alpha(opacity=40)';

keeps thowing the error in parsing value for 'filter' declaration dropped

in my css i have

#overlay{
 width: 100%;
 height: 100%;
 background: transparent;
  /* for IE */
  filter:alpha(opacity=100);
  /* CSS3 standard */
  opacity:1.0;
 z-index: 102;
}

might seem like a silly question sorry I am just starting to experiment with javascript

2
Contributors
2
Replies
7
Views
7 Years
Discussion Span
Last Post by shadiadiph
0
.style.opacity = 0.4;
.style.filter = "alpha(opacity=40)";

Edited by fxm: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.