alecks Posted June 10, 2008 Share Posted June 10, 2008 I have a list (<ul>), and I want to remove the items (<li>s) from within it using jQuery. How do I do it? I tried it this way: JavaScript: $(function() { $('ul.test').remove('li'); }); HTML file: <ul class="test"> <li>List item number one.</li> <li>List item number two.</li> </ul> Thanks! Quote Link to comment Share on other sites More sharing options...
alecks Posted June 11, 2008 Author Share Posted June 11, 2008 Nevermind $('ul.test').children('li').remove(); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.