HTML DOM defaultValue 属性

来源:互联网 发布:sql delete多个 编辑:程序博客网 时间:2024/05/19 13:20
//文本框
  $(":text,:password").focus(function(){
    var textHTML =$(this).val();
    if (textHTML ==this.defaultValue) {
     $(this).val("");
    }
  }).blur(function() {
    var textHTML =$(this).val();
    if (textHTML == ""){
     $(this).val(this.defaultValue);
    }
  });
参考
http://www.cnblogs.com/leejersey/archive/2012/07/20/2600646.html
0 0