document වස්තුව
document වස්තුව පිටුව සමඟ අන්තර්ක්රියා කිරීම සඳහා ක්රම සහ
ගුණාංග අඩංගු වේ.
document හරහා පිටුවේ ඕනෑම අංගයක් ලබා ගත හැක,
ඊට පසු එය සමඟ ඕනෑම දෙයක් කළ හැකිය: අන්තර්ගතය වෙනස් කිරීම, css-ගුණාංග වෙනස් කිරීම,
මකා දැමීම, ක්ලෝනය කිරීම සහ වෙනත්.
document වෙතින් 3 ප්රධාන
අංග සෘජුවම ලබා ගත හැක:
let html = document.documentElement // <html>
let head = document.head // <head>
let body = document.body // <body>
ආශ්රිත ලිපි
-
getElementByIdක්රමය -
getElementsByClassNameක්රමය -
getElementsByTagNameක්රමය -
querySelectorක්රමය -
querySelectorAllක්රමය