Also, to be clear, the val() method returns the value of an element. With a text input, the value is the text entered into it.
\[javascript\]\[/javascript\]\[javascript\]\[/javascript\]What this means is that ready() is a method associated with an event, specifically the browser window’s event of the DOM having been loaded.
\[javascript\]\[/javascript\]The jQuery documentation discusses all of the event-related methods, of course. There are several related to key events, and other important ones like: submit(), for when a form is submitted; select(), for when an element is selected; and, resize(), for when the browser window is resized. They’re all well documented, with examples. And, of course, these are all browser-independent ways of handling events in jQuery.
In the next post, I plan on discussing some of jQuery’s effects, like hiding and showing elements.