How can I pass a variable as the value for jQuery .attr?
<p>Using <a href="http://api.jquery.com/attr/" rel="nofollow">jQuery attr()</a> what would be the proper syntax to pass a variable in as the value.  What I am trying to do is :</p>

<pre><code>var under700 = 'image.jpg'

$('.two_images img').attr('src', (under700) );
</code></pre>

<h2>Edit</h2>

<p>Judging from the responses, I may have oversimplified this.  Here is the rest of the function if that adds any clarity.</p>

<pre><code>    $(document).ready(function() {
     function imageresize() {
         var contentwidth = $('#two_up').width();
         var under700 = '&lt;?php bloginfo('template_url'); ?&gt;/scripts/timthumb.php?src=&lt;?php echo $image_img_tag[0] ?&gt;&amp;w=340'
         if ((contentwidth) &lt; '700'){
     // I also tried defining the variable here
             $('.two_images img').attr('src', under700 );
             } else { 
     // this one works fine
             $('.two_images img').attr('src','&lt;?php echo $image_img_tag[0] ?&gt;');
             }
     }
 imageresize();//Triggers when document first loads     
 $(window).bind("resize", function(){//Adjusts image when browser resized
 imageresize();
});
</code></pre>
