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
- there can not more 1 element having same id.
- ul can not immediate child of ul.
but if want remove nested ul try following line.
$("#members-list ul li").unwrap()
look @ jsfiddle
Comments
Post a Comment