Try using a closure:
function init() {
var textScroller = document.getElementById('textScroller');
var text = 'Hello how are you?';
var c = 0;
function run() {
textScroller.innerHTML += text[c++];
if (c
The problem in your code is that the code you put in the string will run in the global context, where textScroller is not defined (it is defined inside your function).