I tried this JavaScript code:
dx = document.getElementById('box').style
dx.backgroundColor= '#fff'
dx.visibility = "visible";
dx.width = 800 + "px" ;
dx.height = 40 + "px" ;
dx.top = 600 + "px" ;
dx.overflow = "hidden" ;
dx.marginLeft = "-400px";
tab = "<table width='800' border='0' cellpadding='1' > <tr> <td width='75' ></td> <td width='200'></td> <td width='75' ></td> <td ></td> </tr> <tr> <td align='left' valign='middle'><div align='right'>Contact</div></td> <td colspan='4' align='left' valign='middle'><input name='Pcontact' type='text' id='Pcontact' size='20' /> Number <input name='Pnumber' type='text' id='Pnumber' size='20' /> Mail <input name='Pmail' type='text' id='Pmail' size='25' /> <input name='addcontact' type='button' id='addcontact' value='Add Contact' /></td> </tr> </table>" ;
document.getElementById('box').innerHTML = tab
dx.opacity = 10 ;
and this CSS for the box element:
#box {
position:fixed;
width: 600px;
height: 700px;
top: 40px ;
border: 2px solid black;
background-color:#CCC;
left:50% ;
margin-left:-300px;
visibility:hidden ;
overflow:scroll ;
}
I expected this to reduce the opacity, but it seems to have no effect. What is wrong, and how do I fix it?
opacityhas a range of 0 to 1, you are setting it to 10.You probably mean
0.1or perhaps0.9.