Making a website interactive is possible thanks to the Document Object Model, usually referred to as the DOM. The DOM is…