diff --git a/lib/dom.js b/lib/dom.js index 01794c8b2..22cdb5cd2 100644 --- a/lib/dom.js +++ b/lib/dom.js @@ -609,10 +609,10 @@ Document.prototype = { }, getElementsByClassName: function(className) { - const pattern = new RegExp(`(^|\\s)${className}(\\s|$)`); - return new LiveNodeList(this, base => { + var pattern = new RegExp("(^|\\s)" + className + "(\\s|$)"); + return new LiveNodeList(this, function(base) { var ls = []; - _visitNode(base.documentElement, node => { + _visitNode(base.documentElement, function(node) { if(node !== base && node.nodeType == ELEMENT_NODE) { if(pattern.test(node.getAttribute('class'))) { ls.push(node);