I have this snippet of code, which fails at var link:
var obj = $(this[0]);
var html = obj.html();
var link = html.find('a[href*=/comment/reply]');
This is an ajax response from a submitted form. The output of what I get back from the var html is as follows:
===><div class="comment-new-success"><a id="new"></a>
<a id="comment-482"></a>
<div class="comment">
<div class="submitted">Submitted by <a href="/user/1" title="View user profile.">NAME</a> on Sun, 07/10/2011 - 12:48.<span class="new"> *new</span></div>
<div class="content clearfix"><p>123123123123122</p>
</div>
<div class="links_box"><ul class="links"><li class="comment_delete first"><a href="/comment/delete/482?token=e1fba5ef1c99c5a3760313b53f582972">delete</a></li>
<li class="comment_edit"><a href="/comment/edit/482">edit</a></li>
<li class="comment_reply last"><a href="/comment/reply/6/482">reply</a></li>
</ul></div></div>
</div><===(string)
How do I properly get the “/comment/reply/6/482” variable as the var link in the above example. The code (I thought) should work fine, but doesn’t
The answer was this: