Welcome to WebmasterWorld Guest from 54.226.242.132

Forum Moderators: open

Message Too Old, No Replies

JQuery - Copy Closest Link

     
9:17 pm on Jan 9, 2013 (gmt 0)

Junior Member

5+ Year Member

joined:Aug 17, 2010
posts: 188
votes: 2


I'm trying to duplicate a link in the message but I can't seem to get the syntax right it seems to select the first file no matter what instead of the one the box appears under.

I want to "find closest to this"

Line 21:
$(this).next(".largeFile-confirm").attr('href',$('.largeFile').closest('a').attr('href'));

Any help would be appreciated!

[edited by: rwilson at 9:51 pm (utc) on Jan 9, 2013]

9:49 pm on Jan 9, 2013 (gmt 0)

Junior Member

5+ Year Member

joined:Aug 17, 2010
posts: 188
votes: 2


Fixed it.

$(this).next(".largeFile-confirm").attr('href',$(this).closest('a').attr('href'));