Element Modification
Once you retrieve the reference to an element in the DOM, you can modify any of the element's properties.
Modify content
HTML content can be controlled using element.innerHTML
attribute but this approach is dangerous as it can lead to XSS (Cross-Site Scripting) vulnerabilities.
In addition to the security issues, updating the innerHTML
forces the browser to parse the HTML then update the DOM content. This can have bad performance results.
Modify properties
Modify the structure
Create a DOM element
Append an element
Remove an element
CSSOM (CSS Object Model)
Last updated