Ques:- What is difference between Shadow Dom and real DOM?
Asked In :-
Angular Minds, ScriptsHub Technologies, Surya Software, Infiniti Software Solutions, Payoda, tringapps, KareXpert Technologies, PredictiveHire, DePronto Infotech, Softserve Global,
Right Answer:
The real DOM (Document Object Model) is the standard representation of a web page's structure, where changes can be slow because the entire tree needs to be re-rendered. Shadow DOM, on the other hand, is a web standard that allows developers to encapsulate a part of the DOM, creating a separate, isolated subtree that can be manipulated independently without affecting the rest of the document.
The real DOM (Document Object Model) is the standard representation of a web page's structure, where changes can be slow because the entire tree needs to be re-rendered. Shadow DOM, on the other hand, is a web standard that allows developers to encapsulate a part of the DOM, creating a separate, isolated subtree that can be manipulated independently without affecting the rest of the document.
Comments
The Shadow DOM is a browser technology designed primarily for scoping variables and CSS in web components. The Virtual DOM is a concept implemented by libraries in JavaScript on top of browser APIs.