onblur onfocus

<input type="text" name="user" value="请输入..." onblur="if(this.value='')value='请输入...'" onfocus="if(this.value='请输入...')this.value=''">


<script type="text/javascript">
    function _02110811onblur(o) {
        if (this.value == '') {
            this.isAir = true; this.value = '请输入...'
        }
    }
    function _02110811onfocus(o) {
        if (this.isAir == true || typeof this.isAir == "undefined") {
            this.value = ''; this.isAir = false;
        }
    }
</script>
<input type="text" value="请输入..." onblur="_02110811onblur.call(this);" onfocus="_02110811onfocus.call(this);" />

你可能感兴趣的:(JavaScript)