Element indicates the html elements which consists of html tags and contents present inside it.
Some important selectors are explained below,
We can select the html element by id value using getElementById method.
In the above example, we are finding the element which has id value as testid and it is stored in elem variable.
Next by using style property of the elem variable we are changing the background color of the specified element.
elem.style - using this we can change all the css properties, in this example it is used to set the background css property as red.
In a html document, various html elements may contain same class value, so this must be returned in an array.