jquery on
2023-09-11 14:14:20 时间
https://api.jquery.com/on/
.on( events [, selector ] [, data ], handler )Returns: jQuery
Description: Attach an event handler function for one or more events to the selected elements.
-
version added: 1.7.on( events [, selector ] [, data ], handler )
-
eventsType: StringOne or more space-separated event types and optional namespaces, such as "click" or "keydown.myPlugin".
-
selectorType: StringA selector string to filter the descendants of the selected elements that trigger the event. If the selector is
null
or omitted, the event is always triggered when it reaches the selected element. -
dataType: AnythingData to be passed to the handler in
event.data
when an event is triggered. -
handlerA function to execute when the event is triggered. The value
false
is also allowed as a shorthand for a function that simply doesreturn false
.
-
-
version added: 1.7.on( events [, selector ] [, data ] )
-
eventsType: PlainObjectAn 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).
-
selectorType: StringA 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.
-
dataType: AnythingData to be passed to the handler in
event.data
when an event occurs.
-
The .on()
method attaches event handlers to the currently selected set of elements in the jQuery object. As of jQuery 1.7, the .on()
method provides all functionality required for attaching event handlers. For help in converting from older jQuery event methods, see .bind()
, .delegate()
, and .live()
. To remove events bound with .on()
, see .off()
. To attach an event that runs only once and then removes itself, see .one()
相关文章
- jQuery验证控件jquery.validate.js使用说明+中文API
- jQuery file upload --Multiple File Input Fields in One Form
- jQuery on() 方法问题
- UE4 Run On Server与Run on owning client
- 记一次艰难的jquery easy-ui ajax post 体验
- javascript/jquery 常见功能实现(持续更新...)
- jquery限制文本框只能输入金额
- jQuery验证控件jquery.validate.js的使用介绍
- jquery.validate中使用remote,remote相同值不校验问题解决
- jQuery插件之验证控件jquery.validate.js
- 【面试题】封装jQuery源码以及实现jQuery的扩展功能
- [转载][jQuery] Cannot read property ‘msie’ of undefined错误的解决方法
- jquery widgets 弹框
- JQuery的click、bind、delegate、off、unbind
- 最最基层的ajax交互代码jquery+java之间的json跨域传递以及java的json代码返回