I'm trying to get the value of a clicked anchor, but I'm not sure which anchor is clicked or how to hook on it using jquery. I have a document.ready function
$(document).ready(function () {
var ActiveBlogStats = $('#BlogSelectList');
$('#BlogSelectList').click(function () {
alert(ActiveBlogStats.text)
}); })
Here is the id I'm working on
<ul class="submenu" id="BlogSelectList">
<xsl:for-each select="oohru/user/oohblog">
<li>
<a>
<xsl:attribute name="href">#<xsl:value-of select="normalize-space(blogid)"/></xsl:attribute>
<xsl:value-of select="oohblogurl"/>
</a>
</li>
</xsl:for-each>
<li><a href="AddNewBlog.aspx">+ Create a new oohblog</a></li>
</ul>
How can I get href from the actual anchor? I do not see how to make document.ready even for elements that do not exist until the document is ready. I believe that I could get the # value from the URL, since clicking on it will update the URL, but I would rather get it directly from the click.
source
share