I forgot the jQuery command that will clear all list elements from a list. I did a bit of searching, done it a bunch of times before, but just simply forgot the command.
$("ul").clear()
$("ul").empty()
both didn't seem to accomplish this.. which command is it again?
UPDATE:
Thanks guys, I must have some syntax error on my selector.
$("ul").empty()
works fine. Is there some other error?
$('input').click(function() {
$('ul').empty()
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<ul>
<li>test</li>
<li>test</li>
</ul>
<input type="button" value="click me" />