jQuery nadrzędny potomek Selector
Przykład
Zaznacz wszystkie elementy <span>, które są potomkami elementu <div>:
$("div span")
Definicja i użycie
Selektor ("rodzic potomka") wybiera wszystkie elementy, które są potomkami określonego elementu.
Potomkiem elementu może być dziecko, wnuk, prawnuk itp. tego elementu.
Składnia
("parent descendant")
Parameter | Description |
---|---|
parent | Required. Specifies the parent element to be selected |
descendant | Required. Specifies the descendant element (of the specified parent element) to be selected |
Spróbuj sam — przykład
Jak wybrać wszystkie elementy <li>, które są potomkami elementu <ul>.