Remove LI using jQuery

Discussion in 'Coding Help' started by ziycon, Oct 5, 2010.

  1. ziycon

    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>

     
  2. davkell

    davkell New Member

    Code:
     var test = $('ul').find('ul');
     $(test).unwrap('ul').unwrap('li');
    
     
  3. ziycon

    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.
     

Share This Page