Hitting a word then highlight
<p>I have tried in hours to make this work.</p>

<p>I need to have a function which highlights the char if it's correct.</p>

<p>Ex, word is "halluluja" and i have a input field.</p>

<p>When user hitting "h" it has to make "h" red in "halleluja", if user hit "ha" after, it has to highlight the a. and so on.</p>

<p>I have tried something with substr, without any luck.</p>

<pre><code>'typing':function(e){
         var c = w.length; //The word length, ex. halleluja
         for ( i=0;i&lt;e.length;i++){ //foreach each
            var o = e.substr(0, e.length); var l = w.substr(i,i+1); //my typing substr, and the char substr
            if ( o.toLowerCase() == l.toLowerCase()){ //correct
                //highlight the letter.
            }
         }
      },
</code></pre>

<p>The word container is here which outputs the word in that container.</p>

<pre><code>    document.getElementById('wordContainer').innerHTML = w;
</code></pre>
