常用input文本框內(nèi)容自動(dòng)垂直居中并默認(rèn)提示文字單擊為空

字號(hào):


    三個(gè)功能:
    1、內(nèi)容自動(dòng)垂直居中
    2、默認(rèn)提示文字顯示灰色
    3、單擊后變?yōu)榭?BR>    代碼如下:
    <input type="text" name="wd1" id="qy_1" maxlength="100" autocomplete="off" value="請(qǐng)輸入企業(yè)名稱" onfocus="javascript:if(this.value == '請(qǐng)輸入企業(yè)名稱') this.value = ''; this.style.color='gray';" onblur="if(this.value == '') {this.value = '請(qǐng)輸入企業(yè)名稱'; this.style.color = 'gray';}">