jquery cousin element
Posted
by salmane
on Stack Overflow
See other posts from Stack Overflow
or by salmane
Published on 2010-04-20T21:59:42Z
Indexed on
2010/04/20
22:03 UTC
Read the original article
Hit count: 158
jQuery
I am trying to locate the closest element that contains a class....this is in an effort to find the "cousin" of the current element that i have.. the following did not work :
$('myelement').closest ('*:has(.class1)').find('class_cousin')
I am using the * in closest since i am not sure what type element is the one i am looking for nor do I know if it has any classes or ID ( i am trying to keep it general for a plugin)
any idea how I could do it? thank you
© Stack Overflow or respective owner