2005/06/12 | 隐藏显示text
类别(WEB相关) | 评论(0) | 阅读(58) | 发表于 13:56
<!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=gb2312" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript">
function setDisplay2()
{
    if(document.getElementById("txtId").style.display=="")
    {
        document.getElementById("txtId").style.display="none";
    }
    else
    {
        document.getElementById("txtId").style.display="";
    }
}
function setDisplay(a)
{
    if(document.getElementById(a).style.display=="")
    {
        document.getElementById(a).style.display="none";
    }
    else
    {
        document.getElementById(a).style.display="";
    }
}

</script>
</head>
<input type="text" name="txtId" maxlength="6" value="2513" />
<input type="text" name="txtName" maxlength="6" value="Ken" />
<a href="#" onclick="javascript:setDisplay2()">2513Display2</a>
<select style=width:100 onchange="this.style.width=this.options[this.selectedIndex].text.length*7+25;">
<option>12345
<option>1234567890
<option>123456789098765
<option>1234567890987654321
</select>

<body>
</body>
</html>
0

评论Comments