Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the event methods of jQuery

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article introduces the relevant knowledge of "what are the event methods of jQuery". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The event method triggers or appends the function to the event handler of the selected element.

The following table lists all the jQuery methods used to handle events.

Method description bind () has been deprecated in version 3. 0. Use the on () method instead. Attach an event handler to the element blur () attach / trigger fuzzy event change () attach / trigger change event click () attach / trigger click click event dblclick () attach / trigger double click event delegate () has been deprecated in version 3.0. Use the on () method instead. The current or future specified child element die () that appends the handler to the matching element is deleted in version 1.9. Delete all event handlers added using the live () method error () was removed in version 3. 0. The current DOM element in the append / trigger error event event.currentTarget event bubbling phase event.data contains optional data passed to the event method when binding the currently executed handler event.delegateTarget returns the element event.isDefaultPrevented () of the jQuery event handler that is attached to the current call returns whether event.preventDefault () event.isImmediatePropagationStopped () is called for the event object and whether event.stopImmediatePropagation () event is called for the event object .isPropagationStopped () returns whether event.stopPropagation () event.namespace is called for the event object and returns the namespace event.pageX specified when the event is triggered. Event.pageY returns the mouse position relative to the left edge of the document event.pageY returns the mouse position relative to the upper edge of the document event.preventDefault () prevents the default action of the event event.result when the event returns mouse movement the input or exit element event.result contains the event triggered by the specified event The last / last value event.stopImmediatePropagation () returned by the component handler prevents calls to other event handlers event.stopPropagation () to prevent events from bubbling the DOM tree. Prevent any parent handler from being notified of the event event.target return which DOM element triggered the event event.timeStamp returns the number of milliseconds since the event was triggered event.type returns the event type triggered event.which returns the keyboard key or mouse button pressed by the event event.metakey returns whether the META key is pressed focus () appends / triggers the focus event focusin () when the event is triggered Attach event handlers to focusin event focusout () attach event handlers to focusout event hover () attach two event handlers to hover event keydown () attach / trigger keydown event keypress () attach / trigger keystroke event keyup () attach / trigger keyup event live () removed in version 1.9. Add one or more event handlers to the current or future selected element load () removed in version 3. 0. Attach event handlers to load events mousedown () attach / trigger mousedown events mouseenter () attach / trigger mouseenter events mouseleave () attach / trigger mouseleave events mousemove () attach / trigger mousemove events mouseout () attach / trigger mouseout events mouseover () attach / trigger mouse hover events mouseup () attach / trigger mouseup event off () delete event handlers on () attached using the on () method The handler is attached to the element one () to add one or more event handlers to the selected element. Each element of this handler can only trigger $.proxy () to get the existing function and return a new function with a specific context ready () specifies the function to be executed when DOM is fully loaded resize () attach / trigger resize event scroll () attach / trigger scroll event select () attach / trigger selection event submit () attach / trigger submission event toggle () removed in version 1.9. Attach two or more functions to switch between click events trigger () trigger all events bound to the selected element triggerHandler () trigger all functions unbind () bound to the specified event of the selected element have been deprecated in version 3.0. Use the off () method instead. Removing the added event handler undelegate () from the selected element has been deprecated in version 3.0. Use the off () method instead. The event handler unload () that deletes the selected element now or in the future has been deprecated in version 3. 0. Attach event handlers to unload events

This is the end of the content of "what are the event methods of jQuery". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report