Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [JavaScript]Co nie tak z funkcją?
cisu
post
Post #1





Grupa: Zarejestrowani
Postów: 157
Pomógł: 1
Dołączył: 15.03.2008
Skąd: Mirostowice Dolne

Ostrzeżenie: (0%)
-----


Mam kod
  1. function showHideCat(id) {
  2. if (getElementById('download-cat-' + id).style.display == "block") {
  3. getElementById('download-cat-' + id).style.display = "none"; }
  4. else {getElementById('download-cat-' + id).style.display = "block";}
  5. }

i nie chce mi to działać. Dlaczego?
Go to the top of the page
+Quote Post
nospor
post
Post #2





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




nie ma czegos takiego jak getElementById...
jest document.getElementById
Go to the top of the page
+Quote Post
Skie
post
Post #3





Grupa: Zarejestrowani
Postów: 555
Pomógł: 84
Dołączył: 20.02.2008
Skąd: Małopolska

Ostrzeżenie: (0%)
-----


NIE getElementById() tylko document.getElementById()
Go to the top of the page
+Quote Post
cisu
post
Post #4





Grupa: Zarejestrowani
Postów: 157
Pomógł: 1
Dołączył: 15.03.2008
Skąd: Mirostowice Dolne

Ostrzeżenie: (0%)
-----


No, zapomniałem całkiem o tym jednym słowie. Teraz działa, thx
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 07:57