Copy an attribute from one element to another with jQuery
<p>I have the following jQuery code which doesn't seem to be doing anything. When the link is clicked, I'm trying to get the value of its <code>url</code> attribute to be copied into the <code>iframe</code>'s <code>src</code> attribute. </p>

<p>Basically this is supposed to make links open up in an iframe (the content of the iframe is replaced every time a new link is clicked) instead of acting like normal links.</p>

<p>So what is wrong with my code?</p>

<pre><code>$('p.tweet a').click(function(){
    var link = $(this).attr('url');
    $('iframe').attr('src',link);
})
</code></pre>
