jquery obj.find problem in javascript -



jquery obj.find problem in javascript -

i have snippet of code, fails @ var link:

var obj = $(this[0]); var html = obj.html(); var link = html.find('a[href*=/comment/reply]');

this ajax response submitted form. output of var html follows:

===><div class="comment-new-success"><a id="new"></a> <a id="comment-482"></a> <div class="comment"> <div class="submitted">submitted <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 "/comment/reply/6/482" variable var link in above example. code (i thought) should work fine, doesn't

$('a[href*="/comment/reply"]')

see jsfiddle: http://jsfiddle.net/hcbt3/ grabbed text link demonstrate it's correctly selecting anchor.

or grab more specific 1 if have more 1 comment/reply:

$('a[href*="/comment/reply/6/482"]')

javascript jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -