jquery - How can I use parents('ul') to select the nearest/ closest only? -



jquery - How can I use parents('ul') to select the nearest/ closest <ul> only? -

i have html,

<ul> <li>a <ul> <li><a href="#">1</a></li> <li><a href="#">2</a></li> </ul> </li> </ul>

how can utilize parents('ul') select nearest/ closest <ul> not toppest?

to closest parent, utilize parents('ul:first').

jquery html-lists parents

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

c# - Can ProtoBuf-Net deserialize to a flat class? -

javascript - Change element in each JQuery tab to dynamically generated colors -