Jquery to insert src attribute of iframes to be their respective id's
<p>I am trying to dynamically add the src attribute to iframes, taken from their respective id's.</p>

<p>Here is what I am working with (using improper use of 'this' but you should get what I am trying to do.)</p>

<pre><code>$(this).parent().find("iframe").attr('src', http://www.youtube.com/embed/" + $(this).attr('id'));
</code></pre>

<p>my iframe code looks something like this:</p>

<pre><code>&lt;iframe id = "XpOPKZB8dgY" src=""&gt;&lt;/iframe&gt;
</code></pre>

<p>some more context if it helps:</p>

<pre><code>&lt;script&gt;    
    $(document).ready(function() {
        $("iframe").attr('src', '');   
        $(".details").slideUp();   
        $("a.date").click(function() {   
            var key = $(this).parent().attr('class');  
            $(this).parent().children("div").slideToggle('slow');    
            $(this).parent().find("iframe").attr('src', "http://www.youtube.com/embed/" + $(this).attr('id');                    
            $(document.body).animate({    
                'scrollTop':   $(this).offset().top    
            },   1000);    
        });  
    });

&lt;/script&gt;
</code></pre>

<p>Thanks!</p>
