jquery unwrap a ul nested inside another with the same id -


hello html looks (i didn't make mistakes 1 ul nested inside next , both have same id)

<ul id="members-list">     <li>1</li>     <li>2</li>     <li>3</li>     <li>4</li>     <ul id="members-list">         <li>5</li>         <li>6</li>         <li>7</li>         <li>8</li>     </ul> </ul> 

i want use jquery().unwrap(); remove second ul , closing tag. leave li elements

you have made 2 mistakes

  1. there can not more 1 element having same id.
  2. ul can not immediate child of ul.

but if want remove nested ul try following line.

$("#members-list ul li").unwrap() 

look @ jsfiddle


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -