文本框获取焦点和失去焦点事件

$('.address').focus(function(){
    if($(this).val()=='收货详细地址:')
    {
      $(this).val('');
    }
  })
  $('.address').blur(function(){
    if($(this).val()=='')
    {
      $(this).val('收货详细地址:');
    }
  })

猜你喜欢

转载自blog.csdn.net/czlearnunity3d/article/details/87714220