ऑब्जेक्ट document
ऑब्जेक्ट document में पेज के साथ इंटरैक्शन के लिए methods और
properties शामिल हैं।
document के through पेज के किसी भी element को
प्राप्त किया जा सकता है,
उसके बाद उसके साथ कुछ भी किया जा सकता है: content बदलना, css-properties बदलना,
हटाना, clone करना आदि।
document से 3 मुख्य
elements सीधे प्राप्त किए जा सकते हैं:
let html = document.documentElement // <html>
let head = document.head // <head>
let body = document.body // <body>
यह भी देखें
-
method
getElementById -
method
getElementsByClassName -
method
getElementsByTagName -
method
querySelector -
method
querySelectorAll