Questions tagged [parent]

In an oriented tree, the parent is the previous node before the node of interest. The word parent can then be used in countless abstractions of computer science. The container of contained graphic or logic items can be called a parent. The inherited class in OOP can be called the parent.

2764 questions
337
votes
14 answers

How may I reference the script tag that loaded the currently-executing script?

How can I reference the script element that loaded the javascript that is currently running? Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD tag.
geuis
270
votes
6 answers

How to find a parent with a known class in jQuery?

I have a
that has many other
s within it, each at a different nesting level. Rather than give every child
an identifier, I rather just give the root
the identifier. Here’s an example:
John Smith
  • 8,096
  • 11
  • 44
  • 66
215
votes
4 answers

super() fails with error: TypeError "argument 1 must be type, not classobj" when parent does not inherit from object

I get some error that I can't figure out. Any clue what is wrong with my sample code? class B: def meth(self, arg): print arg class C(B): def meth(self, arg): super(C, self).meth(arg) print C().meth(1) I got the sample…
Ehsan Foroughi
  • 2,800
  • 2
  • 16
  • 19
184
votes
15 answers

How can I return to a parent activity correctly?

I have 2 activities (A and B) in my android application and I use an intent to get from activity A to activity B. The use of parent_activity is enabled:
ashiaka
  • 3,762
  • 8
  • 28
  • 43
179
votes
9 answers

How to call a parent method from child class in javascript?

I've spent the last couple of hours trying to find a solution to my problem but it seems to be hopeless. Basically I need to know how to call a parent method from a child class. All the stuff that I've tried so far ends up in either not working or…
YemSalat
  • 15,862
  • 12
  • 39
  • 50
173
votes
9 answers

Changing the child element's CSS when the parent is hovered

First of all, I'm assuming this is too complex for CSS3, but if there's a solution in there somewhere, I'd love to go with that instead. The HTML is pretty straightforward.
Text Block 1 …
Hartley Brody
  • 7,043
  • 12
  • 33
  • 46
152
votes
13 answers

How do I get the n-th level parent of an element in jQuery?

When I want to get, for example, the 3rd level parent of the element I must write $('#element').parent().parent().parent() Is there a more optimal method for this?
Artur Keyan
  • 7,403
  • 12
  • 49
  • 64
127
votes
8 answers

Make div (height) occupy parent remaining height

http://jsfiddle.net/S8g4E/ I have a container div with two children. The first child has a given height. How can I make the second child to occupy the "free space" of the container div without giving a specific height? In the example, the pink div…
Alvaro
  • 7,575
  • 8
  • 42
  • 70
126
votes
7 answers

Select parent element of known element in Selenium

I have a certain element that I can select with Selenium 1. Unfortunately I need to click the parent element to get the desired behaviour. The element I can easily locate has attribute unselectable, making it dead for clicking. How do I navigate…
f l
  • 1,374
  • 2
  • 8
  • 9
93
votes
5 answers

jQuery: How to get to a particular child of a parent?

To give a simplified example, I've got the following block repeated on the page lots of times (it's dynamically generated):
My link
Tom
  • 28,567
  • 26
  • 84
  • 120
89
votes
6 answers

How to get parent process in .NET in managed way

I was looking a lot for method to get parent process in .NET, but found only P/Invoke way.
abatishchev
  • 92,232
  • 78
  • 284
  • 421
75
votes
7 answers

How to delete parent element using jQuery

I have some list item tags in my jsp. Each list item has some elements inside, including a link ("a" tag) called delete. All that I want is to delete the entire list item when I click the link. Here is the structure of my…
Noob
  • 1,017
  • 2
  • 14
  • 16
70
votes
2 answers

jQuery: get parent tr for selected radio button

I have the following HTML: .... …
Andriy Khrystyanovich
  • 1,292
  • 3
  • 18
  • 38
69
votes
7 answers

js: accessing scope of parent class

I have a jquery class within a normal class in javascript. Is it possible to access variables in the scope of the parent class from a callback function in the jquery class? A simple example of what I mean is shown below var simpleClass = function…
Sam
  • 1,245
  • 2
  • 10
  • 26
64
votes
11 answers

How to make child divs always fit inside parent div?

My question is if there is a way, without using JavaScript, to cause child divs to extend to the borders of their parent, without exceeding those borders, when you cannot know beforehand the size of the parent div? Below is sample markup/styles…
Tim Sheiner
  • 3,023
  • 4
  • 24
  • 22
1
2 3
99 100