Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] Porównywanie referencji nodów
SnakeEater
post
Post #1





Grupa: Zarejestrowani
Postów: 50
Pomógł: 0
Dołączył: 12.03.2010

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


Mam kilka inputów (text), wszystkie klasy card_link i taki kod jQuery:
Kod
$(document).ready(function() {
   var selectedInput = null;
   $('.card_link').click(function() {
    if($(this) !== selectedInput)
    {
        selectedInput = $(this);
        $(this).select();
    }
   })
});


Problem jest taki, że jak kliknę ten sam input dwa razy to i tak warunek if($(this) !== selectedInput) jest spełniony. Sprawdziłem value tych obiektów i są identyczne (w końcu to te same inputy). Czy ktoś wie czemu referencje są różne?
Go to the top of the page
+Quote Post

Posty w temacie


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: 3.10.2025 - 11:39