<div class="container">
<div class="hello">Hello</div>
<div class="goodbye">Goodbye</div>
</div>
{
const ex1 = $('.hello').remove()
const ex2 = $('div').remove('.hello')
}
{
const ex1 = document.querySelectorAll('.hello').forEach(element => {
element.remove()
})
const ex2 = Array.from(document.querySelectorAll('div')).filter(element => {
return element.matches('.hello')
}).forEach(element => {
element.remove()
})
}