|
|
|
|
|
by arp242
1989 days ago
|
|
There are quite a few more examples of this: $('.class').remove()
$('.class').after(...)
vs: var e = document.querySelector('.class')
e.parentNode.removeChild(e)
document.querySelector('.class').insertAdjacentElement('afterend', ...)
|
|
// Edge 12 document.querySelector('.class').remove();
// Edge 17 document.querySelector('.class').after(...);
Where jQuery shines - but also hides a lot of complexity- is when operating on an array of elements, e.g. if you want to remove all elements with a certain class.