経由でTreeWalkerを知って、速度はどうなんだろうなーと思って調べた。 TreeWalkerについてはMozilla Developer Networkを参考にした。 function getTextNodes (parentNode) { var walker = document.createTreeWalker( parentNode, NodeFilter.SHOW_TEXT, { acceptNode: function() NodeFilter.FILTER_ACCEPT }, false ), textNodes = []; while (walker.nextNode()) textNodes.push(walker.currentNode); return textNodes; } function getTextNodes2 (parentNode) { var