web前端|js教程
退格键
web前端-js教程
下面是Js片段在IE9,Firebox 10.0.2 中测试过 :
仿youtube网站源码,ubuntu 获取超级用户,tomcat安装版 项目,学好爬虫需要,php跨域传值,seo采购lzw
$(document).keydown(function (e) {
var doPrevent;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == INPUT || d.tagName.toUpperCase() == TEXTAREA) {
doPrevent = d.readOnly || d.disabled;
}
else
doPrevent = true;
}
else
doPrevent = false;
if (doPrevent)
e.preventDefault();
});
关于如何确定Backspace键的代码可以通过这里.
希望对您Web开发有帮助。
播放器源码,平板上能使用vscode吗,ubuntu商业使用,tomcat更改默认编码,爬虫文本修改,php表单程序,龙华关键词seo优化公司,网站 数据库 模板lzw
如果觉得《JQuery防止退格键网页后退的实现代码【jquery】》对你有帮助,请点赞、收藏,并留下你的观点哦!