首先坚挺键盘事件document.onkeydown判断为backspaceevent.keyCode==8主要的是判断当前焦点不在输入框中document.activeElement.type != "text"