Відмінності між версіями «Підказки для форми»

Матеріал з Wiki Welard
Перейти до навігації Перейти до пошуку
(Created page with 'Можна зробити за допомогою [JQuery] jQuery(document).ready(function(){ $("input, textarea").focus(function(){ if ($(this).attr("value") == $(this…')
 
 
(Не показано одну проміжну версію цього користувача)
Рядок 1: Рядок 1:
−
Можна зробити за допомогою [JQuery]
+
Можна зробити за допомогою JQuery
  
 
  jQuery(document).ready(function(){
 
  jQuery(document).ready(function(){
Рядок 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"))
  });
});