Can't get ID of clicked link
<p>Maybe I'm being crazy, but I can't get the ID of the <code>&lt;a&gt;</code> link that is being clicked. The <code>var</code> for security works fine, and there is definatly content in the ID attribute. I'm I missing something?</p>

<p>Here is the PHP -</p>

<pre><code>&lt;span id="&lt;?php echo $load_post_content_nonce; ?&gt;"&gt;
    &lt;a href="&lt;?php the_permalink(); ?&gt;" id="&lt;?php the_ID(); ?&gt;" class="read-more" target="_blank"&gt;Read more...&lt;/a&gt;
&lt;/span&gt;
</code></pre>

<p>Here is the JS -</p>

<pre><code>$(document).ready(function(){   

    $('a.read-more').live('click', function(e){

        e.preventDefault();

        var id = $(this).attr('id');
        var security = $(this).parent('span').attr('id');

    });

});
</code></pre>

<p>Here is the HTML output from one of the links -</p>

<pre><code>&lt;span id="b494a85e81"&gt;
    &lt;a id="6623" class="read-more" href="http://test.dynedrewett.com/warring-parents-told-to-face-up-not-fall-out-over-contact-with-children/"&gt;Read more...&lt;/a&gt;
&lt;/span&gt;
</code></pre>
