aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js
index 16cd9a7c7..8ed56b7e8 100644
--- a/src/core.js
+++ b/src/core.js
@@ -271,9 +271,14 @@ jQuery.extend( {
// Do not traverse comment nodes
ret += jQuery.text( node );
}
- } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ }
+ if ( nodeType === 1 || nodeType === 11 ) {
return elem.textContent;
- } else if ( nodeType === 3 || nodeType === 4 ) {
+ }
+ if ( nodeType === 9 ) {
+ return elem.documentElement.textContent;
+ }
+ if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}