Reputation:
I need to remove a node from a page, and for that I am using the below mentioned function
document.getElementById(id).removeNode(true);
This function works fine in IE but not in Chrome. Could anyone tell me how should I do it?
Upvotes: 5
Views: 4135
Reputation: 7454
The function removeNode()
seems to be a Microsoft proprietary function, so probably only supported in Internet Explorer (IE).
Since the latest browsers are typically chromium-based (such as Google Chrome and Microsoft Edge "Wave" v79+) I replaced it with remove()
and it seemed to fix the issue:
document.getElementById(id).remove();
Upvotes: 1