Questions tagged [parent-node]

58 questions
3
votes
1 answer

Get parentNode of Current Script Tag

Is there any way to get the parent node of current script tag. I wanted to assign id attribute to the script tag but found that it does not support standard attributes. Actually I want to get the title of a document inside a frame and document.title…
Irfanullah Jan
  • 3,336
  • 4
  • 24
  • 34
3
votes
3 answers

JS: How to automate going up "parentNode" as many times as needed

Let's say I have a div that's called Z.Zthat is a sub-sub-sub... child of adivcalledBwhich is a child of adivcalledA`. All the block from B to Z are set to display=none (A is visible). If I click on a anchor that links to the block Z, I want it to…
MagTun
  • 5,619
  • 5
  • 63
  • 104
3
votes
2 answers

why does parentNode replace all elements of td and not the ones specified?

Hi! Can someone take a look at my code and tell me what's wrong? (No I do not have access to edit the HTML.) Im trying to put id="goToThis" on the first parent that matches v(weekNumber) which is v2 in this case. Problem: It sets it on every parent…
wiaK
  • 65
  • 6
3
votes
1 answer

While loop with node and parentNode not reaching end

I'm trying to do a simple loop and check if nodes/parentNode class name matches a string in a array. Code is as follows: function isInside(list,node) { while( node !== undefined ) { for( var i = 0; i < list.length; i++ ) if(…
user1163278
  • 411
  • 6
  • 20
2
votes
2 answers

How to get parentnode of select element in javascript

I am trying to alter the background color of a table cell if the selected item in a dropdown is changed. I use the same javascript for a textbox and it works fine. In firebug, "cell" is undefined when called from the select. Here is my…
monkeypushbutton
  • 196
  • 1
  • 9
  • 21
2
votes
2 answers

c# Obtain a list of TreeView Parent nodes

If I have a TreeView (myTreeview),how can I obtain a list of all the nodes that are parent nodes? i.e. nodes that have children
TK.
  • 46,577
  • 46
  • 119
  • 147
2
votes
1 answer

Cannot read property `parentNode` of undefined

I have a function that creates a HTML table: makeHTMLTable: function(array){ var table = document.createElement('table'); for (var i = 0; i < array.length; i++) { var row = document.createElement('tr'); var cell =…
The worm
  • 5,580
  • 14
  • 36
  • 49
2
votes
1 answer

How to use the parentNode property multiple times?

I have a question. How can I use the parentNode property multiple times? I know that I can make something like this: document.getElementById("mytag").parentNode.parentNode.remove(); Or something like this. My Problem is not that I can add more or…
Micha93
  • 628
  • 1
  • 9
  • 22
2
votes
3 answers

How to remove every text from a website with Javascript

I want to have a Javascript function that removes every text from a website. The background is that in order to compare the appearance of the rendered DOM in difference browsers, I need to eliminate obvious differences before. As font rendering is a…
Schnodderbalken
  • 3,257
  • 4
  • 34
  • 60
2
votes
4 answers

Basic LINQ syntax

Lets say you have an XML like like this:
Leroy Jenkins
  • 2,680
  • 6
  • 25
  • 33
2
votes
1 answer

Is there a way to use javascript parentNode in a jQuery selector instead of closest()?

I'm sitting over a snippet of code, which is superslow on mobile devices. I have an entry form with about 40 input elements (buttons) in Jquery Mobile. In Jquery Mobile this will mean:
frequent
  • 27,643
  • 59
  • 181
  • 333
1
vote
1 answer

Hello, I am using antd treeselect in my react js project . and when i am clicking on parent node child options are not appearing

const treeData = [ { title: '0-1', value: '0-1', key: '0-1', }, { title: '0-2', value: '0-2', key: '0-2', children: [ { title: '0-0-2', value: '0-0-2', …
1
vote
4 answers

How can I extract the text next to an image with Google Tag Manager?

Here's the challenge: We have an image and text that describes it all nested in the same div. When somebody clicks on that image, we want Google Tag Manager to return that text. Basically, we need to: Go up 3 parent nodes Go down to the child node…
1
vote
3 answers

Local storage - wrong list items appear on refresh

I've created a to-do list with local storage. If you create three list items and delete the second one, the deleted list item will reappear in place of the third item on refresh. Edit: I'm not sure whether it's to do with local storage or with the…
David Webb
  • 31
  • 5
1
vote
1 answer

React TypeError: Cannot read property 'parentNode' of null after document.getElementByID JEST TESTING

I have setup a couple Jest tests but they just are not working and returning this error. TypeError: Cannot read property 'parentNode' of null 44 | console.log(document.getElementById("body")); 45 | var title =…
Dimsquid
  • 480
  • 1
  • 7
  • 21
1
2 3 4