Questions tagged [child-nodes]

Child Nodes represents a node in a structured file like xml, html, json, etc.

127 questions
26
votes
2 answers

Select a subset of childnodes by name

Given this xml doc //... same child nodes //....…
accand
  • 531
  • 1
  • 8
  • 17
11
votes
4 answers

Creating anchor tags dynamically in HTML using JavaScript

I have a question about anchor tags and javascript.Converting a URL to an anchor tag The text box accepts a url (eg. "www.youtube.com") I made a Javascript function that adds "http://" to the link. How do I make it so the convert button adds a link…
Kyle Goertzen
  • 143
  • 1
  • 1
  • 8
10
votes
1 answer

Typescript: The type of TextNode

If you write below code: const e = document.body.firstChild; if (e.nodeType === Node.TEXT_NODE) console.log(e.data); You will get this error on e.data: TS2339: Property 'data' does not exist on type 'ChildNode'. While if the condition be true…
Mir-Ismaili
  • 13,974
  • 8
  • 82
  • 100
5
votes
1 answer

JavaScript ChildNodes Undefined type error?

Hello I am new to coding and have a generic question, I looked everywhere and couldn't find a solution. I was following a javascript tutorial and came across this particular line of code. The childnode states that the property 'backgroundColor' is…
Gianluca Fuoco
  • 193
  • 2
  • 8
4
votes
2 answers

How to get all child nodes from DOMDocument?

I have the following $string = ''; $dom = new…
Nico Martin
  • 1,268
  • 1
  • 14
  • 23
3
votes
2 answers

Using childnodes to change text

I've been learning about javascript and childnodes. For an exercise, we have to switch the text of listitems to uppercase through the use of a parent node. Right now, it seems to add the values in javascript to the list, instead of changing them. It…
3
votes
1 answer

Change size of a childnode in Swift

I have 2 SKSpritenodes: robot & computer robot is the parentNode and computer is the childNode robot.addChild(computer) Now I want to change the size of the computer by just using the name of the parentNode. So I need a code like:…
sdd
  • 889
  • 8
  • 29
3
votes
1 answer

Selecting a child node (DOM)

How can I select the 2nd tag using pure Javascript?
MartinDK81
  • 343
  • 2
  • 8
  • 16
3
votes
1 answer

Detect touch on SKNode (swift)

I have created a container node to put in all my SKSpriteNodes that need to be moved all in one touch, I can detect touches on them normally in iOS 8 but in iOS 7 I can only detect touches on my main node and when I touch an SKSpriteNode that it's…
Ludyem
  • 1,709
  • 1
  • 18
  • 33
3
votes
2 answers

Select values from XML in SQL

I need to select values from an XML document. These values are stored as childnodes as follows: 1 2
Romano Zumbé
  • 7,893
  • 4
  • 33
  • 55
2
votes
1 answer

Typescript ChildNode: `parentElement` and/or `parentNode` is null?

So here is a philosophical question. In TypeScript a ChildNode can be parentless, since both ChildNode.parentElement and ChildNode.parentNode have a null type option. But being ChildNode wouldn't it, by the nature of it, have a parent? I can…
Tokimon
  • 4,072
  • 1
  • 20
  • 26
2
votes
1 answer

How to get a record not from first child XML VBA API

I've got data from WorldBank like this (source: http://api.worldbank.org/V2/country?incomeLevel=LIC) To use this VBA code you need to set References microsoft winhttp services microsoft xml microsoft 2.0 object library
Hanna
  • 23
  • 1
  • 3
2
votes
3 answers

How to get the text from a div which has children in it

I am currently studying JavaScript and I have the following problem. Is it possible to get only the text from a div which has children inside it? I managed to make it work only for the text which appears before the div's children. PS: I would like…
George Smith
  • 415
  • 8
  • 25
2
votes
1 answer

Traversing nodes correctly - javascript childNodes

I am trying to make following piece of code to work for each child node once. THe function is also deleting the node as per logic, for more than one child node it never seems to traverse to each child node. //Deleting from child node var…
NewBee
  • 839
  • 7
  • 18
  • 42
2
votes
4 answers

Javascript - How to remove nodeName or the HTML tag but leave the inside markup alone?

I store in a variable my range that the user has selected. var sel, range, off, tags; sel = window.getSelection(); if (sel.rangeCount) { range = sel.getRangeAt(0); var off = sel.anchorOffset; } else if…
Chris Tarasovs
  • 703
  • 2
  • 21
  • 54
1
2 3
8 9