Reputation: 3
I know that on JS exists a remove() function:
HTMLElement.remove();
I'm just interested to know, if there is a function that does the opposite of remove().
Upvotes: 0
Views: 4658
Reputation: 26
Recently I learned add() function in one of the online tutorials. This worked totally OK on my codes.
Example:
const closeModal = function() {
modal.classList.add('hidden');
}
const openModal = function() {
modal.classList.remove('hidden');
}
Upvotes: 1