<html>
<head>
</head>
<body>
<input tpye="text" value="只允许输入字母" style="color:gray" οnfοcus="this.value='';this.style.color='black'"
οnkeyup="this.value=this.value.replace(/[^a-z]/gi,'')">
<br>
<input tpye="text" value="只允许输入数字" style="color:gray" οnfοcus="this.value='';this.style.color='black'"
onKeyUp="this.value=this.value.replace(//D/gi,'');">
<br>
</body>
</html>