Відмінності між версіями «Підказки для форми»
Перейти до навігації
Перейти до пошуку
(Created page with 'Можна зробити за допомогою [JQuery] jQuery(document).ready(function(){ $("input, textarea").focus(function(){ if ($(this).attr("value") == $(this…') |
|||
| Рядок 6: | Рядок 6: | ||
$(this).attr("value", "") | $(this).attr("value", "") | ||
}); | }); | ||
| − | |||
$("input, textarea").blur(function(){ | $("input, textarea").blur(function(){ | ||
if ($(this).attr("value") == "") | if ($(this).attr("value") == "") | ||
Версія за 07:17, 2 липня 2010
Можна зробити за допомогою [JQuery]
jQuery(document).ready(function(){
$("input, textarea").focus(function(){
if ($(this).attr("value") == $(this).attr("title"))
$(this).attr("value", "")
});
$("input, textarea").blur(function(){
if ($(this).attr("value") == "")
$(this).attr("value", $(this).attr("title"))
});
});