Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 251 Pomógł: 2 Dołączył: 24.08.2005 Ostrzeżenie: (0%)
|
Element DIV zawiera w sobie kilka (dwa) elmentow SPAN.
Z poziomu DIVa chce sie do nich odwolac bez korzystania z id oraz getElementById. Napisalem cos takiego: Kod <style> *.d{width:100%;background-color:#888888;cursor:pointer} *.b{font-weight:bold} *.i{font-style:italic} </style> <div onclick="alert(children[1].className)" class="d"> <span class="b">bold</span> <span class="i">italic</span> </div> Jednak dziala tylko pod IE. Mozilla nie obsluguje 'children'... Jak to napisac, aby chodzilo pod IE i Mozilla (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif) Ten post edytował kufalo 22.01.2006, 17:29:54 |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Przyjaciele php.pl Postów: 5 724 Pomógł: 259 Dołączył: 13.04.2004 Skąd: N/A Ostrzeżenie: (0%)
|
Nie sprawdzane
Kod this.children[ 1 ]....
|
|
|
|
Post
#3
|
|
|
Grupa: Zarejestrowani Postów: 1 086 Pomógł: 8 Dołączył: 10.12.2003 Ostrzeżenie: (0%)
|
Kod this.getElementsByTagName(*)[0] Kod this.getElementsByTagName(*)[1]
|
|
|
|
Post
#4
|
|
|
Grupa: Przyjaciele php.pl Postów: 1 717 Pomógł: 0 Dołączył: 12.06.2002 Skąd: Wolsztyn..... Studia: Zielona Góra Ostrzeżenie: (0%)
|
element.childNodes - wiecej informacji na http://www.quirksmode.org/index.html?/dom/...re.html#domtree
|
|
|
|
![]() ![]() |
|
Aktualny czas: 22.12.2025 - 14:10 |