【发布时间】:2015-08-07 00:02:03
【问题描述】:
是否可以在 Closure 中将事件绑定到类的所有元素?我知道在 jQuery 中它类似于
$('.my_class').click(...)
Closure 中有类似的东西吗?类似的东西
goog.events.listen('.my_class', ...)
【问题讨论】:
-
不幸的是,并非如此。
querySelectorAllNodeList上的正常循环将是最简单的。
标签: javascript dom google-closure google-closure-library