MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / search

Function search

lib/web/CodeMirror/test/test.js:19–24  ·  view source on GitHub ↗
(elt)

Source from the content-addressed store, hash-verified

17 if (elt.getElementsByClassName) return elt.getElementsByClassName(cls);
18 var found = [], re = new RegExp("\\b" + cls + "\\b");
19 function search(elt) {
20 if (elt.nodeType == 3) return;
21 if (re.test(elt.className)) found.push(elt);
22 for (var i = 0, e = elt.childNodes.length; i < e; ++i)
23 search(elt.childNodes[i]);
24 }
25 search(elt);
26 return found;
27}

Callers 1

byClassNameFunction · 0.85

Calls 2

testMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected