title: How to dynamically append text to images in a carousel?
body: <p>The carousel in question is elastislide <a href="http://tympanus.net/Development/Elastislide/index.html" rel="nofollow">http://tympanus.net/Development/Elastislide/index.html</a>, currently mine is displayed after a search with the results inside the carousel but I have no way to add text text dynamically in order to make it clear to the user exactly what the result is. </p>
  
  <pre><code>&lt;!-- Elastislide Carousel and Overlay --&gt;
      &lt;ul id="carousel" class="elastislide-list"&gt;
      &lt;?php
  
  if(isset($_POST["title"]))
  {
    $se = $_POST['title'];
      $DBH = new PDO("mysql:host=$host;dbname=$dbname", $user, $pass);
      $sth = $DBH-&gt;prepare("SELECT subjects_id FROM subjects WHERE title LIKE '%".$se."%'");
      $sth-&gt;execute();
      $result = $sth-&gt;fetchAll();
      $arr  = $result;
      $image=2;
      $length = count($arr);
      for ($i=0; $i &lt; $length &amp;&amp; $i&lt;40; $i++)
      { 
          if ($arr[$i]!="") 
            {
                echo'&lt;li&gt;&lt;a  id="dummy" href="http://localhost/website/subjects/view/'.$arr[$i][0].'" &gt;&lt;img src="images/small/'.$image.'.jpg" alt="image02" /&gt;&lt;/a&gt;&lt;/li&gt;';
  
                $image++;
            }
      }
  } 
  ?&gt;      
  
  &lt;/ul&gt;
  &lt;script type="text/javascript"&gt;    
  ( function($) 
    {
        $( '#carousel' ).elastislide();
    } ) ( jQuery );
  
  &lt;/script&gt;
  &lt;!-- End Elastislide Carousel and Overlay  --&gt;
  </code></pre>