title: Changing image src with jQuery in CodeIgniter platform
body: <p>I'm having a bit of trouble changing the image source, using jQuery, in my CodeIgniter website.</p>
  
  <p>I'm building a custom onclick() function attached to my images (i have a list of 'checkbox' images inside a  list, and when clicked I want to replace it with the 'checked' image), but when I try to alert out the src of that image all I get is 'undefined'. Any help would be appreciated.</p>
  
  <p>HTML code:</p>
  
  <pre><code>&lt;img src="&lt;?php echo imagePath(); ?&gt;icons/checkbox_empty.png" class="checkbox1" onclick="checkbox(1)" /&gt; html text here...
  
  &lt;img src="&lt;?php echo imagePath(); ?&gt;icons/checkbox_empty.png" class="checkbox2" onclick="checkbox(2)" /&gt; html text here...
  and so on...
  </code></pre>
  
  <p>jQuery code:</p>
  
  <pre><code>function checkbox(number){
  var image = $('#checkbox'+number).attr("src");
  alert(image);
  }
  </code></pre>
  
  <p>Once again, any help really would be appreciated. Tim.</p>