Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:50:17+00:00 2026-06-13T13:50:17+00:00

How do you remove a html element which is not in the DOM tree(

  • 0

How do you remove a html element which is not in the DOM tree( stored in a separate structure) by JS

I have a project where i make an audio request (html5)
audio.src=”someserver”
Server long polls and sends the data to audio. and audio plays it.

when audio is finished browser receives a command to stop the audio.

I store these audio elements in a hashtable in javascript and not in dom structure like standard html/

so remove parent/child does not apply.

as far as I know we dont even need to clean these objects as when there is no reference to that object, It should be deleted(internally)
So is setting my audio element to NULL enough. ?

I am getting performance hits in my browser ?

Also a reminder that when we make the audio request there are also 4-5 other longed polled requests.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:50:18+00:00Added an answer on June 13, 2026 at 1:50 pm

    DOM nodes aren’t much different than any other JS object. If they don’t have any references to them, they should get garbage collected.

    That said there may be implicit references. If it’s playing an audio file for instance the browser itself may have references to it in order maintain the player. So as long as the audio element is completely stopped and dereferenced, it should automatically get cleaned up.

    I think you are over thinking this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dom element with html inside chat contains some html elements I'd
Im trying to call a js function on a HTML element which I have
How can I remove certain element inside html()? For instance, I have this html
I have an HTML table, to which I would like to add or remove
I have a html element which is styled (using jquery) with a background image
I'm working with the textarea element in HTML and want to remove the border
how remove html table rows after 2nd row? if in table have 5 row,
If we have an example structure like this: HTML <div id=foo>hello foo</div> JS var
In a project I have to use HTML Quick forms to create elements. I
I have an event attached to a div element that will remove the element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.