Within the DOM, every HTML element is represented as an object, and the programming interface consists of the properties and methods associated with each of these objects.
What is the property?
A property holds a value that can be changed. For example, you can use properties to modify the content inside an HTML element.
What is the method?
A method is an action that you can perform, such as adding or deleting an HTML element.
In the below example, we will set the inner text of the paragraph with the help of the `getElementById` method, while `innerHTML` is a property.
document.getElementById("demo").innerHTML = "Hello World!";
The `getElementById` method.
The innerHTML Property
The easiest way to get and modify the content of an element is by using the `innerHTML` property.