87,920
社区成员
发帖
与我相关
我的任务
分享
<body>
<input type="text" readOnly value="只读的文本框"/>
<input type="text" readOnly value="只读的文本框"/>
<input type="text" readOnly value="只读的文本框"/><br/>
<input type="text" value="可编辑的文本框"/>
<input type="text" value="可编辑的文本框"/><br/>
其他正常的文本区域(按钮后确实要后退)<br/>
其他正常的文本区域(按钮后确实要后退)<br/>
其他正常的文本区域(按钮后确实要后退)<br/>
其他正常的文本区域(按钮后确实要后退)<br/>
其他正常的文本区域(按钮后确实要后退)<br/>
<script>
var ipr = document.getElementsByTagName("input");
for(var i=0;i<ipr.length;i++){
if(ipr[i].type=="text" && ipr[i].readOnly){
ipr[i].onkeydown = function(event){
event = event || window.event;
var which = event.keyCode || event.which;
if(which == 8){
return false;
}
}
}
}
</script>
</body>