<input type="text" id="username" onfocus="myFocus(this,'#f4eaf1')" onblur="myblur(this,'#ffffff')" value="请输入姓名"/>
function myFocus(obj,color){
if(obj.value == "请输入姓名"){
obj.value="";
}
obj.style.backgroundColor=color;
}
function myblur(obj,color){
obj.style.backgroundColor=color;
}