码迷,mamicode.com
首页 > Web开发 > 详细

placeholder js简单实现

时间:2015-08-29 15:20:55      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

1  window.onload = function() {
2          var input = document.getElementById("input");
3           input.onblur = function() {
4                   this.value = (this.value == ‘‘ ? this.defaultValue : this.value);
5               };
6                 input.onfocus = function() {
7                 this.value = (this.value == this.defaultValue ? ‘‘ : this.value);
8             };
9  };

 

placeholder js简单实现

标签:

原文地址:http://www.cnblogs.com/raoyunxiao/p/4769098.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!