<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb" -->

---
title: JavaScript DOM Tutorial – How to Build a Calculator App...
description: The Document Object Model (DOM) is a logical structure that defines how elements in a document can be manipulated and changed. You must first learn how to...
canonical: https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: JavaScript DOM Tutorial – How to Build a Calculator App in JS | daily.dev
og:description: The Document Object Model (DOM) is a logical structure that defines how elements in a document can be manipulated and changed. You must first learn how to...
og:url: https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb
og:image: https://api.daily.dev/og/posts/fDxabxizb.png
og:image:alt: JavaScript DOM Tutorial – How to Build a Calculator App in JS
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# JavaScript DOM Tutorial – How to Build a Calculator App in JS

**[freeCodeCamp](https://daily.dev/sources/freecodecamp)** · [@spruce](https://daily.dev/spruce) · 20 min read · 84 upvotes · 3 comments

## Summary

The Document Object Model (DOM) is a logical structure that defines how elements in a document can be manipulated and changed. You must first learn how to access elements in the DOM before you can manipulate it. How to create a DOM Element JavaScript requires that any element be created before it can be added to the DOM. For this, we use the document.createElement() method.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.freecodecamp.org/news/javascript-dom-build-a-calculator-app/>

## Community discussion

Top comments from developers on daily.dev.

**@devvsakib** · 3 upvotes

> wow, great article

**@muathye** · 1 upvotes

> It's amazing article.

**@udaya** · 1 upvotes

> Good one ✨

---

Tags: [#javascript](https://daily.dev/tags/javascript), [#css](https://daily.dev/tags/css), [#html](https://daily.dev/tags/html), [#iphone](https://daily.dev/tags/iphone), [#dom](https://daily.dev/tags/dom)

[View this post on daily.dev](https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"JavaScript DOM Tutorial – How to Build a Calculator App in JS","url":"https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb"},"datePublished":"2022-09-02T17:01:12.551Z","dateModified":"2022-09-02T17:01:12.473Z","description":"The Document Object Model (DOM) is a logical structure that defines how elements in a document can be manipulated and changed. You must first learn how to...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c43ac0c9d38f8ae7d36a0654e536cadc","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/c43ac0c9d38f8ae7d36a0654e536cadc","isAccessibleForFree":true,"articleSection":"freeCodeCamp","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Spruce Emmanuel","url":"https://daily.dev/spruce","image":"https://media.daily.dev/image/upload/v1678071390/avatars/avatar_TMKMTL9Qr.jpg","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":380}},"commentCount":3,"discussionUrl":"https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":84},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":3}],"keywords":"javascript,css,html,iphone,dom","timeRequired":"PT20M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"freeCodeCamp","item":"https://daily.dev/sources/freecodecamp"},{"@type":"ListItem","position":3,"name":"JavaScript DOM Tutorial – How to Build a Calculator App in JS"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/javascript-dom-tutorial-how-to-build-a-calculator-app-in-js-fdxabxizb","comment":[{"@type":"Comment","text":"wow, great article","datePublished":"2022-09-03T17:24:51.444Z","url":"https://daily.dev/posts/fDxabxizb#c-NDGFwvVam","author":{"@type":"Person","name":"Sakib Ahmed","url":"https://daily.dev/devvsakib","image":"https://avatars.githubusercontent.com/u/88339569?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3}},{"@type":"Comment","text":"It’s amazing article.","datePublished":"2022-09-04T10:44:07.796Z","url":"https://daily.dev/posts/fDxabxizb#c-Z1CgsBLRO","author":{"@type":"Person","name":"Muath Alsowadi","url":"https://daily.dev/muathye","image":"https://lh3.googleusercontent.com/a-/AFdZucoK-hF6uzXIh5K2jBoENm5YOYcbcottCop83LRD=s100"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Good one ✨","datePublished":"2022-09-03T18:12:05.968Z","url":"https://daily.dev/posts/fDxabxizb#c-V4-wu3H3w","author":{"@type":"Person","name":"udaya","url":"https://daily.dev/udaya","image":"https://avatars2.githubusercontent.com/u/54870625?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

