Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [jQuery] button + click event
SDK
post
Post #1





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 6.04.2008

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


Kod js:

  1. $("button.send-msg").click(function(){alert("test");});


Kod html:

  1. <input type="text" id="user-name" name="Name" class="field" title="Podaj swoje imię" />
  2. <input type="text" id="user-email" name="Email" class="field" title="Podaj swój email" />
  3. <textarea id="user-comment" name="Message" class="field" cols="" rows="" title="Tutaj wpisz treść wiadomości"></textarea>
  4. <div class="center"><button class="send-msg">Wyślij</button></div>


Niestety, po kliknięciu na button alert się nie wyświetla. Kombinowałem już różne kombinację, niestety bez sukcesu sad.gif.

Ten post edytował SDK 19.09.2008, 18:29:31


--------------------
Aplikacje mobilne iPhone i iPad: http://generio.pl / http://facebook.com/GenerioPL
Portfolio: http://poslinski.net
Go to the top of the page
+Quote Post
lord_t
post
Post #2





Grupa: Zarejestrowani
Postów: 603
Pomógł: 131
Dołączył: 24.07.2007
Skąd: Górny Śląsk

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


A dałeś
Kod
$("button.send-msg").click(function(){alert("test");});

w ready?

Kod
$(document).ready(function(){
  $("button.send-msg").click(function(){alert("test");});
});


Jesli tak, to co Ci wypisuje firebug?


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





Grupa: Zarejestrowani
Postów: 30
Pomógł: 0
Dołączył: 6.04.2008

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


Dziękuję za pomoc guitar.gif .


--------------------
Aplikacje mobilne iPhone i iPad: http://generio.pl / http://facebook.com/GenerioPL
Portfolio: http://poslinski.net
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: 19.08.2025 - 12:24