clear(element) -> HTMLElement
清除一个文本输入框的内容。
如果文本输入框是第一次获得焦点,则清除文本框的内容:
$('some_field').onfocus = function() { // 如果已经清除过,则什么都不做 if (this._cleared) return // 当代码执行时,"this" 关键字指向控件本身 this.clear() this._cleared = true }