1.实现只带下划线的textbox;

#input1{
border:1px;
boder-bottom-style:solid;
border-bottom-color:red;
boder-bottom-color:color;
boder-top-style:none;
boder-left-style:none;
border-right-style:none;
color:red;
}

2.限定文本框的输入(js);

function txtcontrol(content)
{
if(content.length>2)
{
document.getElementById("txt").value=document.getElementById("txt").value.substring(0.2);
}

}

onpropertychange="txtcontrol(this.value)"

posted on 2012-07-08 21:37  ms.元  阅读(671)  评论(2编辑  收藏  举报