DOM is a treeālike representation of the page structure and its content.
let el = document.querySelector('#elementId');
let el = document.querySelectorAll('a');
let newElement = document.createElement('a');
newElement.innerHTML = 'Contact me';
newElement.setAttribute('href', '/contact-us');
let parentElement= document.querySelect('#parentId');
parentElement.appendChild(newElement);
Events are created in response to user action (eg: clicking on a link) or when an environment changed occurred.
let el = document.querySelector('#elementId');
el.addEventListener('click', function() {
console.log('#elementID clicked');
});