Remove Flashcards
1
Q
Detach a single element
element.detach();
A
element.remove();
2
Q
elements.detach();
A
ES6
elements.forEach(x => x.remove());
ES5
elements.forEach(function(element) { element.remove();
});
3
Q
Remove a single element
element.remove();
A
none
4
Q
Empty a single element
element.empty();
A
element.innerHTML = ‘’;
5
Q
elements.empty();
A
ES6
elements.forEach(x => x.innerHTML = ‘’);
ES5
elements.forEach(function(element) { element.innerHTML = ‘’;
});