<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312">
<title>JScript实现的IP地址输入框</title>
</head>
<body>
<style>
div.IPDiv{background:#ffffffwidth:120font-size:9pttext-align:centerborder:2 ridge threedshadowborder-right:inset threedhighlightborder-bottom:inset threedhighlight} input.IPInput{width:24font-size:9pttext-align:centerborder-width:0}
</style>
<script language="JScript" for="document" event="onkeydown">
if(event.keyCode==13)event.keyCode=9
</script>
<script language="JScript">
var IPlikeInputStr=[]
for(var i=0i<4i++)
IPlikeInputStr[i]="<input class=IPInput name=IPInput type=text size=3 maxlength=3 onkeydown=if(event.srcElement.value.length==3||event.keyCode==39)event.keyCode=9>"+(i==3?"":".")
document.write("<div class=IPDiv>"+IPlikeInputStr.join("")+"</div>")
</script>
放到一个网页中运行即可!
</body>
</html>
<script language="javascript" src="http://www.linkwan.com/gb/broadmeter/VisitorInfo/systeminfo.asp?OnlyAddress=yes"></script>欢迎分享,转载请注明来源:内存溢出
评论列表(0条)