Questions tagged [textnode]

textNodes in DOM, HTML, XML are nodes which contain only text, rather than the other node types of element, comment, and processing instruction.

textNodes in DOM, HTML, XML are nodes which contain only text, rather than the other node types of element, comment, and .

191 questions
0
votes
2 answers

Returning Text Nodes

I'm using this line of code: $("#middle_child").contents().filter(function(){return this.nodeType == Node.TEXT_NODE;}).text(); For now, I'm just placing this in a console.log(). I'm using Chrome for testing & value returns as an empty string, but…
Crystal Miller
  • 741
  • 10
  • 26
0
votes
1 answer

Authoritative list of tags without textnode

I'm looking for an authoritative list of tags that don't have a textnode, e.g.: img, br, etc.
Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
0
votes
0 answers

How can I get all selection html text node?

I use window.getSelection to get the selected text, then I can use getRangeAt to get the actually range I select but how can I get all text node I selected? in the Range's property I can only get the startContainer and endContainer, what about the…
hh54188
  • 14,887
  • 32
  • 113
  • 184
0
votes
1 answer

jQuery bookmarklet textnode not working

$('.messages').children().each(function() { var textNode = $(this); textNode.text( textNode.text().replace("hi", "") ); });` I have…
user43107
  • 97
  • 1
  • 1
  • 3
0
votes
1 answer

How to change a textNode created in a different function

I´m doing a simple show/hide script where I have 2 sections of text that are hidden. I have created 2 "read more" links with help of createTextNode. My problem is that the link text "Read more" is suppose to change to "Hide" once the link has been…
Lisa
  • 416
  • 6
  • 16
  • 29
0
votes
1 answer

get a char inside a span of a div

r o w 1
r o w 2
I am trying to get the string '2' …
user2454455
0
votes
1 answer

scala nodes in html-Strings

my target is to analyze an "html - String". In the end i'd like to extract the Textnodes and datanodes of a string and store them in different lists. With my first appoach I tried to go through a "html - String" recursively. import…
Ansgar Helfrich
  • 41
  • 1
  • 2
  • 6
0
votes
1 answer

XStream Element contains TextNode and Element

I am using xstream to parse XML and everything goes well while.... there is a situation that xstream seem can't handle it. There's one tag named "", but in different xml file, it can contain text node or other XML tag. It can be like this: XML File…
0
votes
0 answers

Get the Element sourrounding a TextNode

I want to get the Element-Node Sourrounding the Text-Node. According to this Element contains a Text-Node, vice versa a text-node should be surounded by a element-node. I need the Element-node(openingTime) to get an attribute (day), but the NodeList…
Leander
  • 1,322
  • 4
  • 16
  • 31
0
votes
2 answers

Looking for an HTML parser to do search/replaces on text nodes

I need to do a lot of various search and replaces within A LOT of static html files. One issue I'm coming up with is I'm getting matches in urls when really all I want to search/replace are text nodes. So that makes regular expressions more…
magenta placenta
  • 1,461
  • 7
  • 22
  • 34
0
votes
2 answers

Find text node, then wrap in tags

I have the following bit of HTML, which I do not have control over:
Dave
  • 686
  • 2
  • 13
  • 31
0
votes
3 answers

Unexpected childNodes behavior

I have some simple HTML and JS code I set up to get a better handle on traversing the DOM. Here's my HTML: Sandbox

Sandbox

mcabrams
  • 686
  • 1
  • 6
  • 23
0
votes
3 answers

Equivalent of innerHTML for text

Possible Duplicate: How does jQuery’s .text() work, internally? I'm looking for the text equivalent of innerHTML, i.e.

Hello, World!

then innerText(p) should return Hello, World!. Note: I'm aware of jQuery's text() function. I want…
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
0
votes
1 answer

Get text nodes with their parent elements sequentially (harder than it seems)

Consider the following markup:
Hello, my name is John
I need to get the text nodes and the elements containing them, sequentially, as in: 1: "Hello, my ",
(HTMLElement) 2: "name", (HTMLElement) 3: " is John",…
Stas Bichenko
  • 13,013
  • 8
  • 45
  • 83
0
votes
1 answer

Is there a way to add an attribute to a text node in javascript?

I want to add an attribute to a text node so that I can uniquely identify it. Is there a way to do this in javascript?
user730569
  • 3,940
  • 9
  • 42
  • 68
1 2 3
12
13