Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> if w JS
asall
post
Post #1





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

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


chce z elementu Var toFocus pobrać ID i sprawdzić IF

if (toFocus.attr("id") == "krok1") { $("#step0").show(); } else { $("#step0").hide(); }
Go to the top of the page
+Quote Post
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Co zawiera zmienna toFocus?


--------------------
Go to the top of the page
+Quote Post
asall
post
Post #3





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

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


var toFocus = $(this.findLastActive() || this.errorList.length && this.errorList[0].element || []);
Go to the top of the page
+Quote Post
trueblue
post
Post #4





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

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


Jeśli więc toFocus nie będzie pustą tablicą, to powinieneś dostać id elementu.
Spróbuj przed ifem wstawić:
alert(toFocus.attr("id"));


--------------------
Go to the top of the page
+Quote Post
asall
post
Post #5





Grupa: Zarejestrowani
Postów: 42
Pomógł: 0
Dołączył: 11.12.2013

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


dzięki kolego już wiem co jest nie tak
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 21.08.2025 - 05:39