DOM
Në shqip përdoret i njëjti emër.
ShpjegimiSQ
DOM-i është mënyra si shfletuesi e organizon faqen HTML në kujtesë — si një pemë elementesh. Me JavaScript mund ta lexosh dhe ta ndryshosh këtë pemë, dhe faqja ndryshon menjëherë para syve.
EnglishEN
The DOM is how the browser organises an HTML page in memory — as a tree of elements. With JavaScript you can read and change that tree, and the page updates right before your eyes.
Si ta mendosh
Si trungu familjar: gjyshi në krye, pastaj fëmijët, pastaj nipërit e mbesat. Çdo element i faqes ka „prindin“ dhe „fëmijët“ e vet.
Lexoje në anglisht
Like a family tree: grandpa at the top, then his children, then the grandchildren. Every element on the page has its own “parent” and “children”.
Shembull kodijavascript
const titulli = document.querySelector("h1");
titulli.textContent = "Titull i ri!";
titulli.style.color = "crimson";