Do elements created with document.createElement stay in memory?
问题 Hi, I'm slowly making a chrome extension, and I need to parse some data that contains html entities, and I need to decode it. I saw in an answer here that I could use document.createElement for it, so I did this: htmlDecode: function(input) { if(/[<>]/.test(input)) { // To avoid creating tags like <script> :s return "Invalid Input"; } var e = document.createElement('div'); e.innerHTML = input; return e.childNodes.length === 0 ? "" : e.childNodes[0].nodeValue; } However I'm worried that