"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Javascript DOM vs BOM!

Javascript DOM vs BOM!

Published on 2024-11-08
Browse:296

Javascript DOM vs BOM!

DOM

DOM stands for Document Object Model and represents the web page. This allows programs to manipulate the document structure, style, and content.

const listDiv = document.getElementById("list-div");

listDiv.classList.add('new-class');
listDiv.classList.remove('new-class');

BOM

BOM stands for Browser Object Model and represents the browser's window. This allows programs to access browsers functionalities. BOM is like the big container which contains DOM and all other javascript stuff.

// DOM is part of BOM.
window.document.getElementById("list-div");

window.innerHeight
window.location.href
window.alert("some-text");
Release Statement This article is reproduced at: https://dev.to/alishgiri/javascript-dom-vs-bom-30ce?1 If there is any infringement, please contact [email protected] to delete it
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3