---
title: "叮叮当当"
author: "nickdine"
date: "2010-08-12T22:43:06Z"
tags: []
categories: ["Web前端"]
slug: "untitled"
draft: false
lastmod: "2010-08-12T22:50:02Z"
id: 736245
url: "https://nickdine.iteye.com/blog/736245"
---

document.onkeydown=function(){if(event.keyCode==8)return false;};
这是屏蔽退格键的

http://www.cnblogs.com/88223100/archive/2008/08/10/1264699.html


<script> 
document.onkeydown   =   function(){ 
        if(event.srcElement.tagName.toLowerCase()   !=   "input"){ 
                if(event.keyCode   ==   8) 
                        event.returnValue   =   false; 
        } 
} 
</script> 
<input   id= "txt "   value= "aaa ">