Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js find all text elements

function textNodesUnder(el){
  var n, a=[], walk=document.createTreeWalker(el,NodeFilter.SHOW_TEXT,null,false);
  while(n=walk.nextNode()) a.push(n);
  return a;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #find #text #elements
ADD COMMENT
Topic
Name
9+6 =