Підказки для форми

Матеріал з Wiki Welard
Перейти до навігації Перейти до пошуку

Можна зробити за допомогою 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"))
  });
});