jQuery remove all list items from an unordered list

$("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" />

http://jsfiddle.net/infernalbadger/D5ss8/

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)