console
function sayHello(){
let hello = document.getElementById('hello')
this.content = "Hello JSRun, My name is zhanzhan.wei!please take care"
typing(hello,this.content)
}
function typing(dom,content,bool){
console.log
this.content = content
this.i = 0
this.typing = function(){
if(this.i<this.content.length+1){
dom.innerHTML = this.content.slice(0,this.i++)+'_'
setTimeout(()=>{
this.typing()
},200)
}else{
dom.innerHTML = this.content
if(!bool)sayName()
}
}
this.typing()
}
sayHello()
<div>
<h1 id="hello"></h1>
<h2 id="name"></h2>
</div>