How can I remove HTML elements inside a UL using jQuery?
client-side, html, javascript, jquery, jquery-selectors
Solution
There a method just for that, empty()
$('#stats-results').empty();
Description: Remove all child nodes of the set of matched elements from the DOM.
No need for "tricks".
Problem
I have the following HTML code: ``` <ul class="message" id="stats-results"> <li>DS1 Records: <span id="ds1Count"></span></li> <li>DEV Records: <span id="devCount"></span></li> </ul> ``` Is there an easy way for me to completely remove the `li` elements from the `ul` using jQuery?