Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 619947 of keypress

  • Revision slug: Web/Events/keypress
  • Revision title: keypress
  • Revision id: 619947
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment Web/Reference/Events/keypress Web/Events/keypress

Revision Content

The keypress event is fired when a key is pressed down and that key normally produces a character value (use input instead).

General info

Specification
DOM L3 {{deprecated_inline()}}
Interface
KeyboardEvent
Bubbles
Yes
Cancelable
Yes
Target
Document, Element
Default Action
Varies: keypress event; launch text composition system; blur and focus events; DOMActivate event; other event

Properties

{{OpenEventProperties()}}{{UIEventProperties()}}{{KeyboardEventProperties()}}{{ModifiersEventProperties()}}{{CloseEventProperties()}}

{{KeyRelatedEvents()}}

Revision Source

<p>The <code>keypress</code> event is fired when a key is pressed down and that key normally produces a character value (use <a href="/en-US/Mozilla_event_reference/input"><code>input</code></a> instead).</p>
<h2 id="General_info">General info</h2>
<dl>
  <dt style="float: left; text-align: right; width: 120px;">
    Specification</dt>
  <dd style="margin: 0 0 0 120px;">
    <a class="external" href="https://www.w3.org/TR/DOM-Level-3-Events/#event-type-keyup">DOM L3</a> {{deprecated_inline()}}</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Interface</dt>
  <dd style="margin: 0 0 0 120px;">
    <a href="/en-US/docs/DOM/KeyboardEvent" title="https://en-US/docs/DOM/KeyboardEvent">KeyboardEvent</a></dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Bubbles</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Cancelable</dt>
  <dd style="margin: 0 0 0 120px;">
    Yes</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Target</dt>
  <dd style="margin: 0 0 0 120px;">
    Document, Element</dd>
  <dt style="float: left; text-align: right; width: 120px;">
    Default Action</dt>
  <dd style="margin: 0 0 0 120px;">
    Varies: <code>keypress</code> event; launch text composition system; <code>blur</code> and <code>focus</code> events; <code>DOMActivate</code> event; other event</dd>
</dl>
<h2 id="Properties">Properties</h2>
<p>{{OpenEventProperties()}}{{UIEventProperties()}}{{KeyboardEventProperties()}}{{ModifiersEventProperties()}}{{CloseEventProperties()}}</p>
<h2 id="Related_Events">Related Events</h2>
<p>{{KeyRelatedEvents()}}</p>
Revert to this revision