Page 1 of 1

JavaScript HTML DOM Examples

Posted: Fri Oct 27, 2023 9:08 am
by Guest
JavaScript HTML DOM Examples


Examples of using JavaScript to access and manipulate DOM objects.

The Document Object

Display all name/value pairs of cookies in a document
Display the domain name of the server that loaded the document
Display the date and time the document was last modified

Display the title of a document
Display the full URL of a document
Replace the content of a document
Open a new window, and add some content
Display the number of elements with a specific name
Display the number of elements with a specific tag name

Document Object Explained


The Anchors Collection


Find the number of anchors in a document
Find the innerHTML of the first anchor in a document



The Links Collection

Display the number of links in a document
Display the href attribute of the first link in a document



The Forms Collection

Find the number of forms in a document
Find the name of the first form in a document



The Images Collection

Return the number of images in a document
Return the id of the first image in a document


CSS Manipulation

Change the visibility of an HTML element
Change the background color of an HTML element














+1

Reference: https://www.w3schools.com/js/js_dom_examples.asp

Re: <t>JavaScript HTML DOM Examples</t>

Posted: Thu Apr 23, 2026 12:18 am
by sibil36237
Beberapa waktu lalu saya mulai menyadari bahwa membaca berita tidak selalu membuat saya lebih paham. Banyak artikel terasa terpotong-potong dan sulit diikuti. Saat mencoba mencari sumber yang lebih jelas, saya menemukan Wartawarga News, yang menyajikan konten dengan susunan lebih rapi. Setiap topik dijelaskan secara bertahap sehingga lebih mudah dipahami. Tidak ada kesan terburu-buru dalam penyampaiannya. Hal ini membantu saya membaca dengan lebih tenang dan fokus. Seiring waktu, saya merasa lebih mudah menghubungkan informasi yang saya baca setiap hari.