simple javascript to animate string printing