2、input里如果没有id属性,请修改为<input type="text" id="t">
3、上述两个"t"是对应关系,如果你不喜欢用"t",那可以用其他的名字代替
为什么一定要放到JS文件中呢,这样会比较麻烦,但也不是不能.代码如下:window.onload=function(){
document.getElementsByName('email')[0].onfocus=function(){
document.getElementsByName('email')[0].value=''
}
}