What is an DOM and API?

API - Application Programming Interface Image from https://www.redhat.com/en/topics/api/what-are-application-programming-interfaces


While Learning the Web Designing or Web Development you will an term which is API everywhere online on the internet and it does have an very Ferocious definition of It Everywhere on the Internet like
---
API is the acronym for Application Programming Interface, which is a software intermediary that allows two applications to talk to each other. Each time you use an app like Facebook, send an instant message, or check the weather on your phone, you’re using an API.
---
In Simplest form It as an Mediator for us to Receive some data from other software.

D.O.M. API of JavaScript:

Before understanding any API or D.O.M. API there is an Explanation.
JavaScript Is Scripting Language Which Can Be used to change and manipulate the data just like the Programming language similar to C/C++ Programming, Java, Python Programming language.It Is Mostly Used for Client Side (Web Browser Page) Scripting.

Any Browser have an JavaScript Language Preinstalled But Our JavaScript Can't Understand an HTML page our JavaScript Only Understand Data Like Class, Objects, Arrays, Integer, Text, Boolean Value Not HTML Files. So some engineers make an Super Class Named document.

D.O.M. API changes a HTML File to an document class and it's elements as an subclass or objects

like

HTML for Us looks like this

---

<head>

    <title>text</title>

</head>

---

But for an JavaScript Engine It Looks something not completely like this

---

class head {

    var innerHTML = class ChildElement::title {

        var innerHTML = "text";

    };

---

by this convention our JavaScript Can Understand What is title tag, what we can do with them like methods etc.,

Comments