¡@

Home 

javascript Programming Glossary: child.nodetype

In JavaScript, how can I replace text in an HTML page without affecting the tags?

http://stackoverflow.com/questions/1444409/in-javascript-how-can-i-replace-text-in-an-html-page-without-affecting-the-tags

i 0 var child element.childNodes i if child.nodeType 1 ELEMENT_NODE var tag child.nodeName.toLowerCase if tag 'style'.. elements replaceInElement child find replace else if child.nodeType 3 TEXT_NODE replaceInText child find replace function replaceInText..

How can I use jQuery to style /parts/ of all instances of a specific word?

http://stackoverflow.com/questions/1501007/how-can-i-use-jquery-to-style-parts-of-all-instances-of-a-specific-word

childi 0 var child element.childNodes childi if child.nodeType 1 findText child pattern callback else if child.nodeType 3.. child.nodeType 1 findText child pattern callback else if child.nodeType 3 var matches var match while match pattern.exec child.data..

How to check if element has any children in Javascript?

http://stackoverflow.com/questions/2161634/how-to-check-if-element-has-any-children-in-javascript

child element.firstChild child child child.nextSibling if child.nodeType 1 1 Element hasChildElements true break All of that is part.. child element.firstChild child child child.nextSibling if child.nodeType 1 1 Element rv true break return rv share improve this..

getElementsByTagName() equivalent for textNodes

http://stackoverflow.com/questions/2579666/getelementsbytagname-equivalent-for-textnodes

i var child current.childNodes i if child.nodeType 3 result.push child.nodeValue else findTextNodes child .. elements i .childNodes 0 if elements i .hasChildNodes child.nodeType 3 results.push child.nodeValue getElementsByTagName handicap..

dom wrapping a substring in textnode with a new span node

http://stackoverflow.com/questions/4040495/dom-wrapping-a-substring-in-textnode-with-a-new-span-node

surrounderCreateFunc var child el.lastChild while child if child.nodeType 1 surroundInElement child regex createImage else if child.nodeType.. 1 surroundInElement child regex createImage else if child.nodeType 3 surroundMatchingText child regex surrounderCreateFunc child..

jQuery find/replace without changing original text

http://stackoverflow.com/questions/4060056/jquery-find-replace-without-changing-original-text

childi 0 var child element.childNodes childi if child.nodeType 1 var tag child.tagName.toLowerCase if tag 'script' tag 'style'.. tag 'textarea' findText child pattern callback else if child.nodeType 3 var matches if typeof pattern 'string' var ix 0 while..

Get content between comments

http://stackoverflow.com/questions/7594661/get-content-between-comments

for var i 0 i children.length i var child children i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim.. i if child.nodeType 3 child.nodeValue.trim continue if child.nodeType 8 child.nodeValue.trim name if record record true continue.. for var i children.length 1 i 0 i var child children i if child.nodeType 8 child.nodeValue.trim name if record record true continue..

jQuery selector for an element that directly contains text?

http://stackoverflow.com/questions/7896455/jquery-selector-for-an-element-that-directly-contains-text

for var i 0 i n i var child element.childNodes i if child.nodeType 3 child.data.indexOf text 1 elements.push element break ..