Document Object Model

Document Object Model

As a beginner, learning html, css and javascript you must at a point ask yourself question like, cant i build a website without javascript or say whats is javascript doing that i cant ignore?

Yes, there is a place for each it, html to add content, CSS to style and Javascript for functionality or interactive and some call it behaviour.
For example, When your alarm wakes you 5am, you either off it or snooze it uisng the button, so think of all the content you see (html), then how the alarm is designed(CSS) i.e interface then when you press the button to left or right and something happened(Javascript).

Another question you will likely asked is how does this behaviour happen? It’s simple, javascript accessing the content in HTML by communicating with the browser using the properties, methods, and events in the interface called the Document Object Model, or DOM, it ia a tree-like representation of the web page that gets loaded into the browser.

So here is how DOM works by targeting the content throught the element and ,

Leave a Reply

Your email address will not be published. Required fields are marked *