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

How to get the text before & after the hyperlink using Selenium and Xpath

I am trying to find cases using Xpath/Selenium where there is no white-space before the hyperlink. e.g.

Click on thislinkto access the data

` This renders as Click on thislinkto access the data Problem : Locate all the
sarbjit
  • 3,786
  • 9
  • 38
  • 60
0
votes
0 answers

JavaScript getting innerHtml for all text nodes in nested elements

Need to process text inside uncertain layers of nested nodes using following function: function processTextNodesIn(elem) { if (elem) { for (var nodes = elem.childNodes, i = nodes.length; i--;) { var node = nodes[i], nodeType =…
Daolin
  • 614
  • 1
  • 16
  • 41
0
votes
2 answers

what is the difference between

and text nodes?

i'm learning HTML, and it is not clear yet to me what is the difference in using a text node or a

element. more precisely, what are the advantages and disavantages of using a

element? what about text nodes?

gdor11
  • 43
  • 8
0
votes
1 answer

Adding pictures to choices in a text adventure game

I am very new to the community and forgive me if I misword things but! I'm currently working on an text adventure game and I was wondering if it was possible to add pictures to specific choices. I attached the code below in hopes someone could give…
dangerdan
  • 11
  • 2
0
votes
3 answers

How can I use php to remove tags with empty text node?

How can I use php to remove tags with empty text node? For instance,
remove remove

remove remove But I want to keep the tag with text node like this,
Run
  • 54,938
  • 169
  • 450
  • 748
0
votes
0 answers

Random TextNode appearing in Django authentication templates

I am using custom templates with django.contrib.auth.urls and I've noticed that in the top left corner I have plain text appearing that isn't part of my template e.g. "Password Reset" on the password reset page, "Password Change" on the change…
Chris
  • 183
  • 2
  • 11
0
votes
3 answers

Javascript, append node adds whole array instead of last element

So I'm still learning javascript and for my first to do list project I've gotten to the point where I can add the array to the HTML page but instead of taking the last element and adding it it adds the whole array to each line. How do I change it so…
scorpio
  • 61
  • 1
  • 8
0
votes
2 answers

  not displaying properly in javascript

I'm trying to add lines to my page using javascript. I'm eventually planning on generating ascii art from it, but that's besides the point. For some reason, the text |    | renders properly as part of html, but not as a textNode.…
import huh
  • 93
  • 9
0
votes
1 answer

How to get specific text that belongs to div class


:: Before 0212 / 897645
:: Before …
0
votes
2 answers

Append child same text node is not working

I found the answer. Insert HTML element two (or more) times using JavaScript But I need in depth knowledge about this. How does this happened without for loop or cloning? let strong = document.createElement('strong'); let text =…
Tamerlan
  • 119
  • 1
  • 5
0
votes
2 answers

Update textNode with setInterval and For Loop. Something not working

I am trying to solve this question from w3 resources. QUESTION: Write a JavaScript program to find 1st January is being a Sunday between 2014 and 2050. I tried solving it and attached the code below. I can correctly log the answers but when I am…
0
votes
2 answers

how can i change the background colour for every 'e' character in all of these names\/

I would like the output to look like this: stephen peter ben but with the 'e' characters having a background colour. Is this possible using the below code and some javascript?
stephen
Steve
  • 625
  • 2
  • 5
  • 17
0
votes
0 answers

Are there faster ways for collecting all text nodes than using NodeIterator?

The goal is to collect all text nodes that are direct or indirect ancestors of the body element that meet certain criteria. The problem is that collecting nodes via the method nextNode of a NodeIterator object seems really slow. I did some…
0
votes
1 answer

How to find/get the preceding-sibling node of a text node?

So I'm trying to get the span node in the html below using xpath, and the only things I want to be used in the xpath are the text node "follower" and the span node itself, not any other nodes.
  • Farzad
    • 13
    • 4
  • 0
    votes
    3 answers

    how to read string only and ignore other element in JQuery

    I have the following 'td'element, and want to read out the string part (cell 1) ONLY without the 'span' part, how can i do that in jQuery? cell 1 Thanks.
    ohana
    • 285
    • 1
    • 5
    • 20