title: Changing text of label dynamically in jquery in html
body: <p>I am trying to learn Jquery. Having a problem in dynamically changing the Text of label. </p>
  
  <p>Here is my code</p>
  
  <p>I have </p>
  
  <pre><code>$db = new db();
  $rings = $db-&gt;query("SELECT * FROM rings");
  </code></pre>
  
  <p>Now later on I am adding all the rings in a slider</p>
  
  <pre><code>foreach($rings as $ring){
      echo '&lt;li&gt; &lt;input type="image" src="' . $ring['ringThumbNailImagePath'] . '" name="checked" value="" width="150" height="150" /&gt;&lt;/li&gt;';
  }           
  </code></pre>
  
  <p>There is a label somewhere in code</p>
  
  <pre><code>&lt;label for="ringName" id="ringName" style="color: #701344; font-size: 10pt" &gt;&lt;/label&gt;
  </code></pre>
  
  <p>Now on clicking the Ring  I want to change text of label dynamically. </p>
  
  <p>How can i do this in jquery.</p>
  
  <p>I have done following things</p>
  
  <p>Created a file : and added this in my main html <code>&lt;script  src="js/jquery.rings.js"&gt;&lt;/script&gt;</code></p>
  
  <p>Contents are </p>
  
  <pre><code>$('input[type="image"]').click(function()
  {
     $ring = $(this).val();
     $('label#ringName').text($ring['ringSetName']);
  });
  </code></pre>
  
  <p>Also i changed the input to this</p>
  
  <pre><code>         echo '&lt;li&gt; &lt;input type="image" src="' . $ring['ringThumbNailImagePath'] . '" name="checked" value=$ring width="150" height="150" /&gt;&lt;/li&gt;';
  </code></pre>
  
  <p>Howver on clicking nothing happens, how can i debug what is not working?</p>