What is Model ? Object Model in JavaScript ?

What is Model ?

A model is a representation of a real-world entity or concept. It can be used to describe the structure and behavior of the entity or concept. A model can be represented in many different ways, such as text, diagrams, or code.

An object model is a way of representing data and behavior using objects. Objects are self-contained entities that have both data and behavior. The data is represented by the object’s properties, and the behavior is represented by the object’s methods.

JavaScript is an object-oriented programming language, which means that everything in JavaScript is represented by an object. This includes primitive data types such as numbers and strings, as well as more complex data structures such as arrays and objects.

The JavaScript object model is a powerful way to organize and manage data. It allows you to create reusable components and to encapsulate data and behavior. This can make your code more modular and easier to maintain.

Document Object Modal ?

The document Object Model (DOM) is a application Programming Interface (API) for HTML and XML documents, with the document Object Model, programmers can create and build documents, navigate their structure, and add, modify or delete elements and content.

Example :-

<!doctype html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">

    <title>Hello, world!</title>
  </head>
  <body>
    <p id="my-heading">This is a first paragraph.</p>

    
   <script>
    const heading = document.getElementById("my-heading");
    heading.style.color = "red";
   </script>

    <!-- Option 1: Bootstrap Bundle with Popper -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>

    
  </body>
</html>

Output: –

Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.

Related Posts

How to Install Drupal 10 on Linux ?

In this tutorial we’re going to learn how to install Drupal 10 on Linux server. Follow this tutorial i have installed and run the project in very…

Best DevOps Freelancer in the World

In the dynamic and ever-evolving world of DevOps, finding individuals who not only excel in their technical capabilities but also lead with innovation and insight is rare….

File structure of drupal | Basic Directory Structure of a Drupal ?

What is Drupal ? Drupal is a popular open-source content management system (CMS) written in PHP and built upon the Symfony framework. It is used worldwide to…

How to send attachment files to email using laravel | Upload Document and send Mail in Laravel

In this tutorial im going to demonstrate how to upload document and send data via Email. Please follow some easy steps mentioned below. First let’s go to…

How to Insert Data using Tinker?

In this tutorial i’m going What is tinker and why using it and how to insert data using of tinker in easy way. I’m going to describe…

Top 25 Linux Commands for Users ?

In this tutorial i’m going to share Top 50 Important Linux Command for users with example. 1. Use of ls -la command. The ls -la command is…

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x