INPUT输入框灰体提示

INPUT输入框灰体提示

<input type="text" value='15 words limit' style="color:#999999" onblur="inputTips_blur(this,'15 words limit')" onfocus="inputTips_focus(this,'15 words limit')">
function inputTips_focus(obj, defaultValue){
    if(obj.value==defaultValue){
        obj.value='';
        obj.style.color='#000';
    }
}
function inputTips_blur(obj, defaultValue){
    if(!obj.value){
        obj.value=defaultValue;
        obj.style.color='#999';
    }
}

 

你可能感兴趣的:(input)