diff --git a/src/dom/getTextContentAccessor.js b/src/dom/getTextContentAccessor.js index 1475481e0382..f9d141c7ca8d 100644 --- a/src/dom/getTextContentAccessor.js +++ b/src/dom/getTextContentAccessor.js @@ -30,9 +30,11 @@ var contentKey = null; */ function getTextContentAccessor() { if (!contentKey && ExecutionEnvironment.canUseDOM) { - contentKey = 'innerText' in document.createElement('div') ? - 'innerText' : - 'textContent'; + // Prefer textContent to innerText because many browsers support both but + // SVG elements don't support innerText even when
does. + contentKey = 'textContent' in document.createElement('div') ? + 'textContent' : + 'innerText'; } return contentKey; }