Unable to get jQuery '+variable+' within selector working
<p>I am trying to change images based on the first character inside an h2 tag that corresponds to the id of a collection of images within a div called jquery_image</p>

<p>If I have the following code then my images will change as expected</p>

<pre><code>$(".jquery_image img:not([id=1)").hide();
$(".jquery_image img[id=2]").show();
</code></pre>

<p>However as soon as I try to change the images using the variable jTitle nothing happens</p>

<pre><code>var jTitle = ($(this).text().substring(0,1));   
// alert(typeof jTitle); &lt;&lt; string
$(".jquery_image img:not([id='+jTitle+'])").hide();
$(".jquery_image img[id='+jTitle+']").show();
</code></pre>

<p>Why does this code not work? What am I doing wrong.
Thanks</p>
