解决input date placeholder 不起
2017-09-15 本文已影响0人
左耳右耳记得忘却
****css****
.tuan input[type="date"]:before{
color:#A9A9A9;
content:attr(placeholder);
}
.tuan input[type="date"].full:before {
color:black;
content:""!important;
}
****html****
<input type="date" name="" id="text" placeholder="(最长不得超过100天)" onclick="change(this)" >
****js****
function change(obj){
if(obj.value==''){
obj.className="full"
}else{
obj.className=''
}
}