京东快递查询


<div>
<span style="font-size:24px;"></span>
<input type="text">
</div>
<script>
var txt=document.querySelector("[type=text]");
var span=document.querySelector('span');
txt.addEventListener('keyup',function () {//按键弹起
span.innerHTML=txt.value;//
})
txt.addEventListener("blur",function () {//失去焦点
txt.style.color="#ccc";
span.style.display='none';
})
txt.addEventListener("focus",function () {//获得焦点
      txt.style.color="";
span.style.display='block';
})
</script>
posted @ 2021-08-08 20:55  rigorous  阅读(321)  评论(0)    收藏  举报