Hi I'm new to jquery I just wanted to seek some help on getting the href attr in anchor tag using div/span ID selector and anchor tag class
<span id="view-post-btn"><a href="" class="button button-small">View Member</a></span>
<div id="preview-action">
<a class="preview button" href="" target="wp-preview" id="post-preview">Preview Changes</a>
Thanks :)
Hi I'm new to jquery I just wanted to seek some help on getting the href attr in anchor tag using div/span ID selector and anchor tag class
<span id="view-post-btn"><a href="https://blog.pany./site1/archives/team/post-1" class="button button-small">View Member</a></span>
<div id="preview-action">
<a class="preview button" href="https://blog.pany./site1/archives/team/post-1" target="wp-preview" id="post-preview">Preview Changes</a>
Thanks :)
Share Improve this question asked Apr 10, 2014 at 7:19 user2450064user2450064 1131 gold badge5 silver badges15 bronze badges2 Answers
Reset to default 6try
$('#view-post-btn').find('a').attr('href');
$('#preview-action').find('a').attr('href');
try this.
$('#view-post-btn').find('a.button').attr('href');
$('#preview-action').find('a.preview').attr('href');