---
title: "firefox  onKeydown 事件 备忘"
author: "pipi709"
date: "2009-07-30T15:37:27Z"
tags: ["Firefox"]
slug: "firefox-onkeydown"
draft: false
lastmod: "2009-07-30T15:37:27Z"
id: 436393
url: "https://pipi709.iteye.com/blog/436393"
---

```
document.onkeydown = function (e){
            var theEvent = window.event || e;
            var code = theEvent.keyCode || theEvent.which;
            if(code == 13){
            alert(code);
               }
}
```