美文网首页
解决input date placeholder 不起

解决input date placeholder 不起

作者: 左耳右耳记得忘却 | 来源:发表于2017-09-15 18:04 被阅读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=''
    }
}

相关文章

网友评论

      本文标题:解决input date placeholder 不起

      本文链接:https://www.haomeiwen.com/subject/jkkesxtx.html