More Mouse and Keyboard Events with the jQuery JavaScript Library
(Page 1 of 4 )
Welcome to the fourth article in an eight-part series on the jQuery JavaScript library. In this part, I will walk you through using a pair of brand new methods provided by the library for processing some additional keyboard-related actions, such as keydown and keyup events.
Introduction
Over the last few months, a brand new player entered the arena of JavaScript frameworks. Thanks to its friendly programming interface and useful features, it has been rapidly adopted by many professional web designers worldwide. I'm talking about the jQuery framework, a neatly-crafted piece of software that allows you to build full-featured JavaScript applications with minor effort, by utilizing a set of truly intuitive methods.
Of course, if you already read the preceding installment of this series, then I should assume that at this stage, you're very familiar with using the API provided by the jQuery library, in order to perform certain common tasks. These include handling some typical mouse events and a few keyboard actions.
During the aforementioned article, I explained how to use the "mouseover()" and "keydown()" methods bundled with the library to develop a couple of sample web applications that were capable of reacting to these specific events.
In those particular cases, the methods were attached to a link within a basic web page, so when this element was clicked, it fired up a function that displayed on screen a trivial alert box. Naturally, the inherent simplicity of these examples is very evident, but they still demonstrated how to use these methods in concrete situations.
However, as you may have guessed, the jQuery library comes with some additional methods for handling several keyboard events with relative ease. I'm going to explain how to utilize these methods for processing both "keyup" and "keypress" events.
Are you ready to learn how to perform all of these useful tasks with jQuery? Let's begin now!
Next: Review: mouse overs and keydown events with jQuery >>
More JavaScript Articles
More By Alejandro Gervasio