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.

2914 questions
382
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
337
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,567
  • 13
  • 51
  • 74
246
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
  • 19,986
  • 13
  • 44
  • 51
234
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
  • 3,010
  • 2
  • 18
  • 20
214
votes
11 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
  • 8,669
  • 14
  • 37
  • 48
189
votes
16 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,994
  • 8
  • 32
  • 45
159
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,643
  • 12
  • 52
  • 65
158
votes
9 answers

Make div (height) occupy parent remaining height

Consider the following HTML/css code sample:
Text
Text
Text
Text
Text
Text
#container { width: 300px; height: 300px; border:1px solid…
Alvaro
  • 9,247
  • 8
  • 49
  • 76
152
votes
8 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,684
  • 2
  • 10
  • 11
109
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
  • 30,090
  • 27
  • 90
  • 124
100
votes
7 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
  • 98,240
  • 88
  • 296
  • 433
83
votes
2 answers

jQuery: get parent tr for selected radio button

I have the following HTML: .... …
Andriy Khrystyanovich
  • 1,422
  • 3
  • 19
  • 38
82
votes
11 answers

How to make child divs always fit inside parent div?

Is there 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 a sample markup/style demonstrating my…
Tim Sheiner
  • 3,253
  • 4
  • 27
  • 22
79
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,077
  • 2
  • 14
  • 16
77
votes
9 answers

parent & child with position fixed, parent overflow:hidden bug

I don't know if there is an issue, but I was wondering why the overflow:hidden does not function on fixed parent/children element. Here's an example: CSS and HTML: .parent{ position:fixed; overflow:hidden; width:300px; height:300px; …
kirkas
  • 1,749
  • 2
  • 12
  • 22
1
2 3
99 100