javascipt问题,点击按钮显示DIV,然后DIV中有一个关闭按钮,关闭时DIV上文本框无法关闭
igis 2007-07-10 09:48:04 javascipt问题,点击按钮显示DIV,然后DIV中有一个关闭按钮,关闭时DIV上文本框无法关闭,如何解决这个问题,代码如下:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" %>
<!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 id="Head1" runat="server">
<title>Untitled Page</title>
<script language="javascript">
function test()
{
var strInfoContext;
strInfoContext = "<div id='diplayinpoi' style='POSITION: absolute; width:295px;height:158px;Z-INDEX: 100;'>";
strInfoContext += "<div id='displayall' style='LEFT: 7px; WIDTH: 283px; POSITION: absolute; TOP: 6px; HEIGHT: 159px; BACKGROUND-COLOR: #ffffff'>";
strInfoContext +="<div id='divToName' style='visibility:visible;'><input type='text' name='txtStart' style='width: 100px'/> vvvv</div>";
strInfoContext += "</div>";
strInfoContext +="<input type='button' value='关闭' style='RIGHT: 10px; POSITION: absolute; TOP:' onclick='hiddeinfo()'/>";
strInfoContext += "</div>";
document.getElementById("div1").innerHTML=strInfoContext;
document.getElementById("div1").style.visibility = 'visible';
}
function vvv()
{
document.getElementById("divToName").style.visibility="visible";
}
function vvv1()
{
document.getElementById("divToName").style.visibility="hidden";
}
function hiddeinfo()
{
document.getElementById("div1").style.visibility = "hidden";
}
</script>
</head>
<body >
<form id="form1" runat="server">
<div id="div1" style="visibility:hidden">
</div>
<input id="Button1" type="button" value="btnview" onclick="test();"/>
</form>
</body>
</html>