Since its introduction injQuery has caused a revolution in front-end scripting. It has made it easier for newcomers to get up and running, decreased prototyping and development time, and has opened the door into an endless supply of new UX and UI elements.
PlainObject An object in which the string keys represent one or more space-separated event types and optional namespaces, and the values represent a handler function to be called for the event s.
String A selector string to filter the descendants of the selected elements that will call the handler. If the selector is null or omitted, the handler is always called when it reaches the selected element. Anything Data to be passed to the handler in event. As of jQuery 1.
For help in converting from older jQuery event methods, see. To remove events bound with. To attach an event that runs only once and then removes itself, see. Event names should only contain alphanumerics, underscore, and colon characters. An event name can be qualified by event namespaces that simplify removing or triggering the event.
A click event handler attached via that string could be removed with. Namespaces are similar to CSS classes in that they are not hierarchical; only one name needs to match. In the second form of. The keys are strings in the same form as the events argument with space-separated event type names and optional namespaces.
The value for each key is a function or false value that is used as the handler instead of the final argument to the method. In other respects, the two forms are identical in their behavior as described below. Direct and delegated event handlers The majority of browser events bubble, or propagate, from the deepest, innermost element the event target in the document where they occur all the way up to the body and the document element.
In Internet Explorer 8 and lower, a few events such as change and submit do not natively bubble but jQuery patches these to bubble and create consistent cross-browser behavior. If selector is omitted or is null, the event handler is referred to as direct or directly-bound.
The handler is called every time an event occurs on the selected elements, whether it occurs directly on the element or bubbles from a descendant inner element. When a selector is provided, the event handler is referred to as delegated.
The handler is not called when the event occurs directly on the bound element, but only for descendants inner elements that match the selector.For me, standard HTML Select element is pretty much annoying. It's ugly. It can't be styled properly in Internet Explorer.
And it can't contain nothing but simple text. benjaminpohle.com() vs onClick.
Additionally, jQuery removes other constructs such as data and event handlers from child elements before replacing those elements with the .
Prototype. All objects have a prototype property. Whenever the interpreter looks for a property, it also checks in the object's prototype if the property is not found on the object itself. jQuery uses the prototype extensively to add methods to jQuery instances.