{"id":12009,"date":"2022-03-10T05:57:12","date_gmt":"2022-03-10T10:57:12","guid":{"rendered":"http:\/\/local.brightwhiz\/?post_type=snippets&p=12009"},"modified":"2022-03-10T06:05:38","modified_gmt":"2022-03-10T11:05:38","slug":"javascript-remove-element-from-the-dom","status":"publish","type":"snippets","link":"http:\/\/local.brightwhiz\/snippets\/javascript-remove-element-from-the-dom\/","title":{"rendered":"JavaScript Remove Element From the Dom"},"content":{"rendered":"\n
JavaScript, remove element:<\/p>\n\n\n\n
var element = document.getElementById("myElementID");\nelement.parentNode.removeChild(element);<\/code><\/pre>\n\n\n\nAlternate:<\/p>\n\n\n\n
var element = document.querySelector('#some-element');\nelement.parentNode.removeChild(elem);<\/code><\/pre>\n","protected":false},"comment_status":"open","ping_status":"closed","template":"","meta":[],"categories":[4,953,27,15,28,16],"tags":[954,328,424,433,471,472,544,638],"yoast_head":"\nJavaScript Remove Element From the Dom [Snippet]<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n