How do you interact with DOM elements?
The easiest way to access a single element in the DOM is by its unique ID. You can get an element by ID with the getElementById() method of the document object. In the Console, get the element and assign it to the demoId variable. Logging demoId to the console will return our entire HTML element.
What is DOM element?
The Document Object Model (DOM) is a programming interface for web documents. It represents the page so that programs can change the document structure, style, and content. The DOM represents the document as nodes and objects; that way, programming languages can interact with the page.
How to get DOM element in Angular 8?
In angular, you have to use Angular API like ViewChild and elementRef to access the DOM. To access the input element in the component, we need to create a template reference variable in the HTML. To create a template reference variable in angular, add any name with the prefix #.