Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text printing on scren

Status
Not open for further replies.

feedfx

Programmer
Jan 8, 2001
1
US
I would like to know how I can read a string, and than have a JavaScript function print on the screen, character by character. I'm a newbie, heavily hooked on this language, I’ve memorized the basics, and have done some of my own code. But a friend who has been in the biz for a while gave this problem to me, and he told me that it would be good practice. Unfortunately, three hours in front of the tube is about all I can take. So I hope some one could hook me up.

Thanx a lot!!

Steve
 
<div id=&quot;freep&quot;></div>
<script>
dar = &quot;Oh no, my horse turned into a fileeater!&quot;
currpos = 0
function typeString(str)
{
if(currpos<str.length)
freep.innerHTML+=str.charAt(currpos++)
else{clearInterval(jack)}
}
jack=setInterval(&quot;typeString(dar)&quot;,100)
</script> jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top