Questions tagged [siblings]

The term "sibling" refers to a kind of relationship between two items in a tree structure. Two items have the sibling relationship if they both have the same parent.

The term "sibling" refers to a kind of relationship between two items in a tree structure. Two items have the sibling relationship if they both have the same parent. The sibling relationship is most commonly used in reference to elements in document model objects (DOM's) such as XML documents or HTML documents.

In XPath, a language used to address and locate parts of an XML document, the sibling relationship is directly supported by two axis:

  • following-sibling axis refers to all the following siblings of the context node, and
  • preceding-sibling axis refers to all the preceding siblings of the context node

In addition, two more XPath axis support the sibling concept indirectly:

  • the following axis and
  • the preceding axis
732 questions
9
votes
1 answer

jquery removeClass only if all checkboxes of the same set (with same class?) are unchecked

The problem When a checkbox is unchecked, if other checkboxes of the same set (with same class?) are checked, the class shouldn't be removed. Please notice there are several sets of checkboxes. (Partially) working…
Defeat9274
  • 93
  • 5
9
votes
3 answers

XPath select all text content for a
except for a specific tag
I searched and tried several solutions for this problem but none of them worked: I have this HTML
Descrição completa
Sala de estar/jantar,2 vagas de…
bslima
  • 1,097
  • 2
  • 15
  • 17
9
votes
2 answers

Change style of all other elements when one element is hovered

Let's say I have a bunch of divs at the same DOM level. When I hover over one, I want all the others to change style (ie. reduce opacity or change background), while the one that is hovered stay the same. I can't use the + or ~ selectors, because I…
Bobe
  • 2,040
  • 8
  • 29
  • 49
8
votes
4 answers

mousedown. propagation on siblings event.targets

I have 2 sibling-nodes with 'position absolute' which both handle mousedown event. How can I trigger the handler of 'div 1' when I am clicking on the transparent area of the 'div 2' (on the pic.)
AlaskaKid
  • 197
  • 1
  • 2
  • 9
8
votes
3 answers

SQL Server Equivalent of Oracle 'CONNECT BY PRIOR', and 'ORDER SIBLINGS BY'

I've got this Oracle code structure I'm trying to convert to SQL Server 2008 (Note: I have used generic names, enclosed column names and table names within square brackets '[]', and done some formatting to make the code more readable): SELECT…
user1058946
  • 243
  • 2
  • 3
  • 14
8
votes
2 answers

beautifulsoup: find the n-th element's sibling

I have a complex html DOM tree of the following nature: ...
...
"#big" is positioned…
Karthik
  • 317
  • 2
  • 5
  • 13
6
votes
4 answers

How to cycle through siblings using jQuery?

I have the folowing code: html:
A
B
C
D
jQuery: $("#next").click(function() { …
Benjamin Crouzier
  • 40,265
  • 44
  • 171
  • 236
6
votes
5 answers

How to detect strictly adjacent siblings

Consider the following HTML where IDs #p1, #p2 and #p3 are siblings (see fiddle):
Paragraph 1 Paragraph 2 This is just loose text.

Paragraph…

Fabricio
  • 839
  • 9
  • 17
1 2
3
48 49