我正在将一个应用程序从 prototype.js 升级到 jquery。
我有这段代码(prototype.js):
var el = ... /* this is done */
if (el.match('.pagination a') && el.href) {
doAjaxStuff()
}
什么相当于Element.match在 jquery 中?
最佳答案
它是 is
功能。
el.is('.pagination a')
关于javascript - jquery - 相当于 Prototype.js 的 "match"函数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9805204/