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

字號:


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