Hi i want to display image from the array using jquery
<pre><code>    &lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=utf-8 /&gt;
&lt;title&gt;Hello World&lt;/title&gt;
    &lt;script src="http://code.jquery.com/jquery-1.7.1.min.js"&gt;
    &lt;/script&gt;
&lt;/head&gt;
&lt;body style="background-color: whitesmoke;"&gt;
&lt;h1 style="text-align: center;"&gt;Welcome World&lt;/h1&gt;
&lt;div style="border: 2px solid gray;width: 25%;margin-left: 40%;"&gt;
    &lt;h2 style="text-align: center;" id="dynaImg"&gt;

    &lt;/h2&gt;
    &lt;div style="position:relative; text-align: center;"&gt;
        &lt;audio controls="true" preload="metadata" autoplay="autoplay"&gt;
            &lt;source src="M7S21_PAP.ogg" type='audio/ogg;  codecs="vorbis"'/&gt;
            &lt;source src="M7S21_PAP.mp3" type='audio/mpeg; codecs="mp3"'/&gt;
            &lt;source src="M7S21_PAP.wav" type='audio/wav;  codecs="vorbis"'/&gt;
        &lt;/audio&gt;
        &lt;button id ="play"&gt;
      Play
    &lt;/button&gt;

    &lt;button id="rewind"&gt;
      Rewind
    &lt;/button&gt;

   &lt;button id="forward"&gt;
      Fast forward
    &lt;/button&gt;

     &lt;button id="stop"&gt;
      Stop
    &lt;/button&gt;

    &lt;button id="restart"&gt;
      Restart
       &lt;/button&gt;
    &lt;/div&gt;

&lt;/div&gt;

  &lt;script type="text/javascript"&gt;
      var audio = $('audio')[0],
              h2= $('h2')[0],
              h2s = ["mona.jpg", "tag-adobe.png"],

              duration, interval, currentTxt;

      (function callee(ready) {

          if (ready !== false) 
          ready = true;

          if (!ready) {
              return audio.addEventListener('canplaythrough', callee);
          }

          if (!duration) {
              duration = audio.duration;
              interval = duration / h2s.length;
          }

          if (isNaN(duration)) return setTimeout(callee, 1000);

          var currentTime = audio.currentTime;

          if (!currentTxt) {
             // $('h2').text(h2s[0]);
             $('#dynaImg').html('&lt;img src="http://cdn.sstatic.net/stackoverflow/img/tag-adobe.png" width="60px" height="60px"/&gt;');
             // h2s[0] = new Image(60,60);
             // h2s[0].src="http://cdn.sstatic.net/stackoverflow/img/tag-adobe.png";
          }

          var currentTimeText = h2s[Math.floor(currentTime / interval)];

          if (currentTimeText != currentTxt ) {
              //$('h2').text(currentTimeText);  

                $('#dynaImg').html('&lt;img src="'+h2s[0]+'" width="60px" height="60px"/&gt;');
            $('#dynaImg').html('&lt;img src="'+h2s[1]+'" width="60px" height="60px"/&gt;');   
        }



          setTimeout(callee, 1000);

      })(false);




      &lt;/script&gt;




      &lt;script &gt;
      $(document).ready(function(){
        $("#play").click(function () {
        audio.play();

            });
            });

        $("#stop").click(function () {
        audio.pause();
        });

        $("#restart").click(function () {
        audio.currentTime=0;
        });

            $("#rewind").click(function () {
            audio.currentTime-= 2.0;
            });

            $("#forward").click(function () {
            audio.currentTime+= 2.0;
            });

   &lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>if (currentTimeText != currentTxt ) true it only display only one image with audio but not updating with audio after 10 sec duration it should display 2nd image after 10 second duration if i kept the alert alert is running fine &amp; displaying image name after 10 sec</p>
