首页 > 其他 > 详细

表单提示字符如何一个一个的出来

时间:2019-05-12 11:25:47      阅读:113      评论:0      收藏:0      [点我收藏+]
<input id=‘qingshuo‘ type=‘text‘ placeholder=‘请输入您要咨询的问题……‘ />
<script>
$(function(){
    var input_hz=0;
    var input_hz1=document.getElementById("qingshuo").placeholder;
    function type(){
        if(input_hz==input_hz1.length+1){
            input_hz=0;
        }
        document.getElementById("qingshuo").placeholder = input_hz1.substring(0,input_hz++);
    }
    setInterval(type, 300); 
})
</script>

技术分享图片

技术分享图片

效果图

 

表单提示字符如何一个一个的出来

原文:https://www.cnblogs.com/lcxin/p/10851404.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!