/p>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
js提示文字input{
width:200px; height:24px;
line-height:24px; border:1px solid #999;
background:#ccc; margin:15px 0 0 100px;
padding:4px; color:#666;
}
.current{
background:#E0FEE4;
border:1px solid #093;
}
var aInp=document.getElementsByTagName('input');
var i=0;
var sArray=[];
for(i=0; i
{
aInp[i].index=i;
sArray.push(aInp[i].value);
aInp[i].οnfοcus=function()
{
if(sArray[this.index]==aInp[this.index].value)
{
aInp[this.index].value='';
}
aInp[this.index].className='current';
};
aInp[i].οnblur=function()
{
if(aInp[this.index].value=='')
{
aInp[this.index].value=sArray[this.index];
}
aInp[this.index].className='';
};
}