Clearing <a> href after loading page with jquery
I am trying to slightly modify the wordpress template. At the moment, the function returns a link to the article, I'm trying to replace this link so that instead of redirecting to another page, it simply inserts the article and loads it.
To do this, I need to reset to bind href after the page loads.
This is the part of the code that interests me:
<?php the_content( __('<img class="readmore" src="/images/readmore.png" title="poo"></img>', 'twentyten' ) ); ?> returns:
<a class="more-link" href="http://henryprescott.com/undgraddissintro/#more-12"> <img title="poo" src="/images/readmore.png" class="readmore"></img></a> However, I want to change this so that instead of a script, a transition to a new page is performed.
So I tried to run this:
$(document).ready(function(){ $("a.more-link").css("href", "#"); alert($("a.more-link").css("href")); } It does nothing, and the warning returns "undefined".
Where am I going wrong, thanks!
+4
3 answers