Submodule 14.2: DOM methods/properties and DOM Recursion
Introduction to DOM methods and properties
DOM methods are actions that can be performed on DOM objects.
DOM properties are the values of the objects that can be added or changed.
Examples of actions we can do are to create new elements, add attributes, changes the content of an HTML element etc.
document.getElementsByClassName("example").innerHTML = "Hello DOM!";
In the above example, the
getElementsByClassName() is the method, whereas the
innerHTML is the property.
You have already see the innerHTML property in action on Submodule 6.1: The model of event-driven programming and Submodule 6.3: Applying the "if" statements.
On the The HTML DOM Element Object page, you can see a list of the different DOM methods and properties.