Remove LI using jQuery

Status
Not open for further replies.

ziycon

New Member
I have the code below, I need to remove the opening UL and LI and the closing LI and UL and just keep the inner UL.

I've tried the everything I can think of but not being an expert in jQuery is letting me down, any help much appreciated.
Code:
<ul>
  <li>
    <ul>
      <li>item 1</li>
      <li>item 2</li>
      <li>item 3</li>
    </ul>
  </li>
</ul>
 

davkell

New Member
Code:
 var test = $('ul').find('ul');
 $(test).unwrap('ul').unwrap('li');
 

ziycon

New Member
That wasn't exactly what I was looking for but I got it working after playing around with jQuery for a bit, thanks for the help though.
 
Status
Not open for further replies.
Top