From 41fb2bf0e62b71614bf6f8080c15f2bccdcfbb6a Mon Sep 17 00:00:00 2001 From: Francesco Moggia FFG Date: Fri, 25 Oct 2013 11:49:01 -0500 Subject: [PATCH] fix(jqLite): find check if the element is a text node find check if the element is a text node. If element is a text node return an empty array. Otherwise invoke getElementsByTagName on the element and return the result Closes #4120 --- src/jqLite.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/jqLite.js b/src/jqLite.js index 727218a94244..85089581ef30 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -809,7 +809,11 @@ forEach({ }, find: function(element, selector) { - return element.getElementsByTagName(selector); + if (element.nodeType==3) { + return []; + } else { + return element.getElementsByTagName(selector); + } }, clone: jqLiteClone,