如何将方法绑定到jquery中的按钮 [英] how to bind the method to button in jquery

查看:107
本文介绍了如何将方法绑定到jquery中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how to bind the method to button in jquery

推荐答案

方法如下: .click()| jQuery API文档 [ ^ ]。



如果没有所有jQuery,它也应该很容易完成:

EventTarget.addEventListener() - Web API | MDN [ ^ ],

或者更简单,更不通用(不是多播): GlobalEventHandlers.onclick - Web API | MDN [ ^ ]。



请参阅我对该问题的评论。编程需要一些努力。 :-)



-SA
This is how: .click() | jQuery API Documentation[^].

It also should be quite easily done without all those jQuery:
EventTarget.addEventListener() — Web APIs | MDN[^],
alternatively, simpler and less universal (not multicast): GlobalEventHandlers.onclick — Web APIs | MDN[^].

Please see my comment to the question. Programming needs some efforts. :-)

—SA


这篇关于如何将方法绑定到jquery中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆