html
<input type="text" name="" id="jgChatInput" class="duihIntI" />
js
<script>
/*输入框依次显示文字*/
var userIput = document.querySelector(".duihIntI");
var i = 0;
var s = "在此输入问题可直接对话";
var clock = setInterval(function() {
i++;
if(i > 12) {
i = 0;
}
var p = s.slice(0, i);
userIput.setAttribute("placeholder", p);
}, 600)
userIput.addEventListener("focus", function() {
clearInterval(clock)
userIput.setAttribute("placeholder", "")
})
/*依次显示文字结束*/
</script>