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
Post a Comment