![]() |
![]() |
-lukasamd- |
![]()
Post
#1
|
Goście ![]() |
Witam,
chciałbym sobie w polu input z nałożoną klasą "testowe" zrobić coś takiego: Kod onfocus="if (this.value == 'nick') {this.value = '';}" onblur="if (this.value == '') {this.value = 'nick';}" tyle tylko, że poprzez jquery. Zrobiłem więc tak:
Niestety brak reakcji, zarówno na zdarzenie blur jak i focus... co zrobiłem źle? Wiem tylko tyle, że nie działają funkcje - gdy dałem inny kod (zmiana klasy innego elementu), wszystko było ok. Ten post edytował lukasamd 26.08.2009, 19:21:12 |
|
|
![]() |
![]()
Post
#2
|
|
Grupa: Zarejestrowani Postów: 35 Pomógł: 0 Dołączył: 27.03.2009 Ostrzeżenie: (0%) ![]() ![]() |
Kod $(document).ready(function() { $(".testowe").focus(function() { if ($(this).val() == 'nick') { $(this).val() = ''; } }); $(".testowe").blur(function() { if ($(this).val() == '') { $(this).val() = 'nick'; } }); }); A to? Ten post edytował adrian.p 26.08.2009, 19:24:45 |
|
|
![]() ![]() |
![]() |
Aktualny czas: 11.10.2025 - 01:44 |