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 -

intellij idea - Update external libraries with intelij and java -

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