Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebUI: Remove elements directly #21840

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ghost3050
Copy link

Since 2013, there has been a native function in JavaScript that removes an element directly:
https://developer.mozilla.org/en-US/docs/Web/API/Element/remove

It works in literally all browsers (see the compatibility table above). It doesn't work in Internet Explorer, but there won't be any difference, since the current modern code doesn't work in IE either, example of constant variables:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const

Key advantages of using remove():

  • Conciseness: It's a more concise way to remove elements.
  • Efficiency: It can be more efficient.
  • Modern approach: It's a modern and widely supported method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant