$(".anything").click() 和 $(".anything").bind(click) 有什么区别
$(".anything").click(function() {
});
$(".anything").bind('click', function() {
});
最佳答案
没什么,click(function() { })
只是 bind("click", function() { })
的快捷方式。
来自 jQuery 文档:
The jQuery library provides shortcut methods for binding the standard event types, such as .click() for .bind('click').
您可以阅读有关 bind()
的更多信息 here .
关于javascript - $ (".anything".click() 和 $ (".anything").bind(click) 有什么区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3965020/