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! Link to comment https://forums.phpfreaks.com/topic/109657-solved-jquery-remove-s-from-a/ Share on other sites More sharing options...
alecks Posted June 11, 2008 Author Share Posted June 11, 2008 Nevermind $('ul.test').children('li').remove(); Link to comment https://forums.phpfreaks.com/topic/109657-solved-jquery-remove-s-from-a/#findComment-563004 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.