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
1 answer

Inserting HTML with my current set up - textNode

Making a text editor that allows you to upload an image, and then it adds the image url and img tag to the content editable div. I have everything working with this snippet... function insertTextAtCursor(text) { var sel, range, html; sel =…
Lovelock
  • 7,689
  • 19
  • 86
  • 186
0
votes
1 answer

How to detect which line was clicked

I have content that hard-breaks and autowraps within a div container. When the user clicks on a word (or image) I want to detect which "line number" was clicked on. I've looked into DOM Level 2 objects like Range and Selection, but there doesn't…
0
votes
2 answers

Javascript: select a textnode

some text
text I want to select
some text
The HTML is like above, I want to select the text between the two images, is there anyway to do this? Some background: I am trying to…
shenkwen
  • 3,536
  • 5
  • 45
  • 85
0
votes
1 answer

Remove contents of an element excluding certain nodes names/types

The idea is I want to remove the contents of an element, excluding the script elements that are used as Handlebarjs templates. The example below is fully working, but I am wondering is there a better approach than what I have now? Using .remove() or…
guinness
  • 63
  • 6
0
votes
1 answer

Display huge text (partly colored)

I am curently working on one visualization, using JavaScript, which should deal with large amount of text. In each sentence there are at least couple of words which I need to color, which means that a single sentence would look something like…
Rita
  • 41
  • 1
  • 3
0
votes
2 answers

JavaScript text nodes properties

I'm little confused about properties of text nodes in JavaScript. Let say that I have this piece of html: JavaScript test
Majak
  • 1,543
  • 1
  • 14
  • 28
0
votes
1 answer

Growing BorderPane based on child's Textnode content in JavaFX

I have a problem figuering out what the best procedure would be, to have a growing and shrinking BorderPane. I want to try and enlarge or shrink the Pane horizontally, based on a Text node child it has (with changing text length). There are some…
Terran
  • 1,091
  • 18
  • 29
0
votes
1 answer

How can I edit a svg.js text node at any time?

I find I can't edit a svg text node at any time like HTML node by using "contenteditable" attribute. How mightI solve it? I have referred to this stackoverflow post. But it doesn't work. How can I get the result that when I double-click a svg text…
Houser
  • 1
  • 1
0
votes
1 answer

create textnode expand and hide

I have been trying to create a textnode that will expand and contract onclick, however it refuses to work in google chrome and displays [object Text] in firefox, where am I going wrong? http://jsfiddle.net/jonSnow70/uf1bbk5q/ window.onload =…
Jon Snow
  • 123
  • 2
  • 11
0
votes
0 answers

Line break TextNode javascript?

I am working on a simple project which is turning out to be difficult for some reason. First let me show you the result I am getting as of now; it's just this: Leicester City vs Manchester United - 9/21 14:30 Now, I want to have the date and time…
nubToMax
  • 1
  • 1
0
votes
1 answer

Get all children of a node in javascript

I want to get all children of

. HTML:

nodlist is an ordered collection of node objects that are children of the current element. If the element has no children, then contains no…

talkhabi
  • 2,669
  • 3
  • 20
  • 29
0
votes
1 answer

Coordinates of specific text fragment in text node

Is it possible to get bounding rect of specific text fragment inside text node? Say I have this HTML

Word1 word2 word3 word4

and I'd like to know bounding rect of word3.
0
votes
1 answer

jQuery text highlighting text nodes break in IE

I'm currently using this great plugin called HighlightJS for highlighting text on a page when they type in a filter field. This works great, except for recently we updated from a very old version of jQuery (1.8.2 to 1.11.0) and this no longer works…
Chris Barr
  • 29,851
  • 23
  • 95
  • 135
0
votes
2 answers

Check of the first text node is a number

I want to check to see if the first node of a div is number and if it's null I'll display a div or not. http://jsfiddle.net/NsXsa/ $(".carcount").bind("DOMSubtreeModified",function(){ $(function() { $(".carcount…
Talha
  • 350
  • 1
  • 4
  • 19
0
votes
3 answers

How to merge parent content inside his first child?

I'm not able to figure out how to merge parent content inside his first child with jQuery. I want to merge all the elements (including text node) of an element within its child. I have this:
Shad Gagnon
  • 475
  • 1
  • 7
  • 20