JSFiddle - React, Tailwind, and code Playground
by A B
HTML
<ul id='ul-items'>
<li id='elem1'>First Element</li>
<li id='elem2'>Second Element</li>
<li id='elem3'>Third Element</li>
</ul>
<button id='remove-element'>Remove Element</button>
JavaScript
$('#remove-element').on('click', function(){
alert('removing...');
try
{
document.getElementById('elem1').remove();
}
catch(ex)
{
alert(ex);
}
});