If you have multiple ul and want to empty specific ul then use id eg:
<ul id="randomName">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
<script>
$('#randomName').empty();
</script>
$('input').click(function() {_x000D_
$('#randomName').empty()_x000D_
})
_x000D_
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>_x000D_
_x000D_
<ul id="randomName">_x000D_
<li>1</li>_x000D_
<li>2</li>_x000D_
<li>3</li>_x000D_
</ul>_x000D_
_x000D_
<ul>_x000D_
<li>4</li>_x000D_
<li>5</li>_x000D_
</ul>_x000D_
<input type="button" value="click me" />
_x000D_