<html>
<head>
<style>
*{ margin:0; padding:0;}
body{ height:100%;}
.dis{ width:100%; background: #cccccc; position:absolute; left:0; right:0; top:0; bottom:0; -moz-opacity:0.5; filter:alpha(opacity=50);z-index:99; height:100%; }
</style>
</head>
<body>
34344444444444444444444<br>
dsdddddddddddddddd<br>
<input type=button value="change" onclick=test()></body>
</html>
<script>
function test()
{
var div = document.createElement("div");
div.className="dis";
document.getElementsByTagName("body")[0].appendChild(div);
}
</script>
<head>
<style>
*{ margin:0; padding:0;}
body{ height:100%;}
.dis{ width:100%; background: #cccccc; position:absolute; left:0; right:0; top:0; bottom:0; -moz-opacity:0.5; filter:alpha(opacity=50);z-index:99; height:100%; }
</style>
</head>
<body>
34344444444444444444444<br>
dsdddddddddddddddd<br>
<input type=button value="change" onclick=test()></body>
</html>
<script>
function test()
{
var div = document.createElement("div");
div.className="dis";
document.getElementsByTagName("body")[0].appendChild(div);
}
</script>
<head>
<style>
*{ margin:0; padding:0;}
body{ height:100%;}
.dis{ width:100%; background: green; position:absolute; left:0; right:0; top:0; bottom:0; -moz-opacity:0.5; filter:alpha(opacity=50);z-index:99; height:100%; }
</style>
</head>
<body>
<select id=sl>
<option>1</option>
<option>2</option>
<option>3</option>
</select><br>
dsdddddddddddddddd<br>
<input type=button value="change" onclick=test() ID="Button1" NAME="Button1"></body>
</html>
<script>
function test()
{
var div = document.createElement("div");
var iframe = document.createElement("iframe"); iframe.className="dis";
div.className="dis";div.appendChild(iframe);
document.getElementsByTagName("body")[0].appendChild(div);}
</script>
<table>
<tr><td>item 1</td></tr>
<tr><td>item 2</td></tr>
<tr><td>item 3</td></tr>
<tr><td>item 4</td></tr>
<tr><td>item 5</td></tr>
</table>
<iframe src="javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100px; height:200px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
</div><a href="#" onclick="document.getElementById('menu').style.visibility='visible'">menu</a>
<a href="#" onclick="document.getElementById('menu').style.visibility='hidden'">hide</a><form>
<select><option>A form selection list</option></select>
</form>
<script>
function test()
{
var div = document.createElement("<div class='dis' oncontextmenu='return false;'>");
var iframe = document.createElement("<iframe class='dis' style='z-index:98;'>");
document.getElementsByTagName("body")[0].appendChild(iframe);
document.getElementsByTagName("body")[0].appendChild(div);
}
</script>
http://blog.csdn.net/dh20156/archive/2006/11/14/1383424.aspx