点击显示div
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> #Layer1 { position:absolute; left:246px; top:84px; width:316px; height:217px; z-index:1; display:none; background-color:red; color:#FFFFFF; } </style> <script type="text/javascript"> function submit(id){ document.getElementById(id).style.display="block"; } </script> </head> <body> <input name="submit" type="submit" id="submit" onclick='submit("Layer1");' value="点击显示层" /> <div id="Layer1">我只是一个层</div> </body> </html>