$(this).parents('div.popup')

On Feb 28, 8:47 pm, riotbrrd <k...@riotbrrd.com> wrote:
> I have a bunch of Divs with class ".popup". Each div is different in
> what it contains; some are simple, some are pretty complex, containing
> tables, other divs, etc..
>
> If I have a link, for example,"Cancel", within that Div, and the only
> thing that I know about Cancel is that 1) it has a parent div.popup
> somewhere up the tree (no idea how many levels), and 2) if I go
> backwards up the tree from Cancel, the first div.popup I encounter
> will be the right one, how can I go about finding the right parent
> div.popup? I'd like to just attach a handler that starts with
> "this" (meaning the Cancel link) and finds the correct div.popup up
> the tree.
>
> Hope this is question is clear. Thanks!
> -Kim

Reply via email to