baixc
$(function() {
    var inputEl = $(\'#input_test\'),
        defVal = inputEl.val();
    inputEl.bind({
        focus: function() {
            var _this = $(this);
            if (_this.val() == defVal) {
                _this.val(\'\');
            }
        },
        blur: function() {
            var _this = $(this);
            if (_this.val() == \'\') {
                _this.val(defVal);
            }
        }
    });
})

HTML:<input type="text" id="input_test" value="input 提示测试" />

 

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-12-24
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-08-16
猜你喜欢
  • 2022-12-23
  • 2021-12-19
  • 2021-10-15
  • 2021-07-03
  • 2022-02-22
  • 2022-12-23
  • 2021-12-21
相关资源
相似解决方案