Questions tagged [parent-node]

58 questions
0
votes
1 answer

Drupal file attachments -> How to view parent node in search results

I'm using an content node type (let's say "A") with file attachments. For search functionality the attachments are being indexed by "Search API" and "Search API Attachments". At the search result view I want to view fields of the parent of a found…
Sysout
  • 91
  • 6
0
votes
1 answer

How to go back to pre-visited node in a binary tree (preorder traversal, solving No.1028 problem in LeetCode )

I'm struggling to solving No.1028 problem in LeetCode by myself. As a step of my solution, I wanna construct a binary tree below by adding nodes one by one in an order of 'preorder traversal'. When I'm done with leftmost nodes with moving the…
0
votes
1 answer

jQuery .remove() does not work with div created inside the function

I've tried a couple of things since yesterday, but I can't achieve my goal. The idea is : When clicking on a character "Div", it appears a little menu to change a parameter inside my website. The problem is, I want to remove the "Class Picker", but…
Brownies
  • 1
  • 1
0
votes
1 answer

How to get parent node name while using django mptt package in django rest serializers?

I am only getting parent id with this code, but i need parent node name . Is it possible to get parent node name ? class Department(MPTTModel,NameStatusModelMixin): desc = models.TextField(blank=True, null=True, default=None) slug =…
user15883648
0
votes
1 answer

Prevent displaying of li element that has nothing to be displayed from object

I have a sidebar with li elements generated with JS but I want to avoid displaying the li element that has some empty elements inside. So far, I succesfully hid the country name and the link name from the sidebar for Ireland but I couldn't figure it…
onweb
  • 75
  • 7
0
votes
2 answers

Hi! I want to remove all the divs inside the container in one go. How can I do that without any class or id of the inside divs?

I have created a form to search for things and added them as div in the container. Now for every new search I want all the divs from the container to be removed. How do I do that? const container = document.querySelector('.container'); const form…
user15392801
0
votes
1 answer

parentElemenst and parentNode are doesn't work to remove item from list

In my react project, my purpose is removing item when I click the trash icon. I tried to reach li elements using parentNode or parentElements but when I do this whenever I click the trash button console shows me different parent elements. Sometimes…
0
votes
2 answers

Multiple parentNode (s) Not Working In Internet Explorer 7

var round1 = output.parentNode.parentNode.parentNode.getElementsByTagName('a')[0].innerHTML Internet explorer 7 gives me the error "Unable to get value of the property 'innerHTML': object is null or undefined" when the code clearly works on ie 9…
Cadell Christo
  • 3,105
  • 3
  • 21
  • 19
0
votes
3 answers

How to examine parentNode classList in an if else statement in javascript

I have a function which is called whenever a checkbox is clicked from a particular group. I am trying to add a class to the input's parent wrapper when the checkbox is checked, and then remove the class when it isn't checked. My problem is, I can't…
wotney
  • 1,039
  • 3
  • 21
  • 34
0
votes
0 answers

google.run.script is not giving error from javascript call

I am trying to figure out server/client data type matching. In the html with javascript, form itself is supposed to be sent to google code.gs.
....buttons and input texts...
-- here the last…
user9669528
0
votes
1 answer

Remove parent element with Javascript using parentNode.removeChild when I only have 1 parent?

I'm working on a project where I have to delete en element in a certain condition (if). My code generates a
  • in which data is inserted via an array. I need to delete that
  • if some conditions are met. Since removeParent() doesn't exist I've…
  • 0
    votes
    3 answers

    Raw javascript: add class to parentNode and remove from siblings

    I have a click event that adds an active class to the link's parentNode. On click the active class should be removed from the siblings of the parentNode. This is the code so far: categories = document.querySelectorAll('.categories'); for(var i…
    jamie
    • 3
    • 4
    0
    votes
    1 answer

    XML Parent node modification using childnode attribute in Powershell

    I'm trying to modify the Parent node attributes using the child node attributes in Powershell. What is the best way to do this? Any pointers are really appreciated. Below is the code. The name of the file is pricefile.xml
    Jose
    • 1,333
    • 5
    • 20
    • 38
    0
    votes
    0 answers

    javascript parentNode is undefined

    Here is my HTML markup -
    // some code goes here...
    And when I try to get parent as follows, It returns undefined. document.getElementsByClassName('my_class').parentNode // returns undefined I…
    Suyash Soni
    • 219
    • 2
    • 9
    0
    votes
    2 answers

    Javascript DOM styling

    I want to reach the parentnode of my list (with an id selector)and style it adding a background color using plain javascript. This is my code, but doesn't work. var listParentNode; listParentNode = getElementById("list2").parentNode; …
    Anna Bannanna
    • 135
    • 3
    • 10