Issue
Basically for element.addEventListener()
, what is the type name of a keyboard type event?
For example:
somelement.addEventListener( <typename>, somefunction, false );
What is the value for <typename>
for a keyboard type event? I'm basically building an AJAX based search box that will display results/suggestions as the user types in the search box.
Solution
It's usually the event name (as defined as inline html) without the word on.
Here's a reference to them all: http://javascript.gakaa.com/c/events.aspx
Edit: Not all HTML elements can use the same events. For example, a div can't have a "load" listener. EX: element.addEventListener("mousedown", doSomething, true);
Key events include: "keydown" "keyup" "keypress"
You can get the keycode via e.getKeyCode(); The window object should be the object listening for keyEvents.
Answered By - Jeffrey Sweeney Answer Checked By - Cary Denson (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.