<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns:v><!--此处为绘图必须//-->
<head>
<title> 输入框演示 </title>
<STYLE>v/:*{behavior:url(#default#VML);}</STYLE><!--此处为绘图必须//-->
<script>
function drawInput(id,name,type,value,event,size){
var html = "";
html += "<v:roundrect fillcolor='white' arcsize='0.1' strokecolor='black' strokeweight='1px' style='position:relative;top:0;left:0;width:"+(size+100)+";height:20'>";
html += "<v:shadow on='T' type='single' color='#b3b3b3' offset='3px,3px'/>";
html += "<v:TextBox inset='0,0,0,0' style='text-align:center;line-height:11pt;height:20'>";
html += "<input id='"+id+"' type='"+type+"' name='"+name+"' value='"+value+"' "+event+" style='border:0px;background-color:#FFFFFF'>";
html += "</v:TextBox></v:roundrect>";
return html;
}
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td><script>document.write(drawInput("tt","","text","text1","",30))</script></td></tr>
<tr><td><script>document.write(drawInput("tt","","text","text2","",50))</script></td></tr>
<tr><td><script>document.write(drawInput("tt","","text","text3","",40))</script></td></tr>
</table>
<script>
var ipt = document.getElementsByTagName("input");
for(i=0;i<ipt.length;i++){
if(ipt[i].type == "text"){
ipt[i].onfocus = function(){
this.style.backgroundColor = "#99CCFF";
}
ipt[i].onblur = function(){
this.style.backgroundColor = "#FFFFFF";
}
}
}
</script>
</body>
</html>
<script>
var ipt = document.getElementsByTagName("input");
for(i=0;i<ipt.length;i++){
if(ipt[i].type == "text"){
ipt[i].onfocus = function(){
this.style.backgroundColor = "#99CCFF";
}
ipt[i].onblur = function(){
this.style.backgroundColor = "#FFFFFF";
}
}
}
</script>