---
title: "Discussion on \"Dom Manipulation In Javascript\" | Hashnode"
description: "Discussion on \"Dom Manipulation In Javascript\". Manipulate DOM like a pro"
url: "https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Dom Manipulation In Javascript](https://nikk.hashnode.dev/dom-manipulation-in-javascript?utm_source=hashnode&utm_medium=feed)

Manipulate DOM like a pro

May 10, 2023 · 8 min read · nikk.hashnode.dev  
Read the article

-   [#devsintechblogs](https://hashnode.com/tag/devsintechblogs)
-   [#web-development](https://hashnode.com/tag/web-development)
-   [#wemakedevs](https://hashnode.com/tag/wemakedevs)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#frontend-development](https://hashnode.com/tag/frontend-development)

## Written by

[Nikhil Mishra](https://hashnode.com/@godnik)

@godnik · Kolkata, India

  
[View profile](https://hashnode.com/@godnik)

From front-end to back-end and everything in between – follow my full-stack web development adventures!🚀

Hi there! I'm learning full-stack web development and I document my journey through blogs and technical articles. I'm passionate about building web applications from the ground up and enjoy exploring all the different technologies involved in the process.

## Responses 4

Markdown supported · ⌘↵ to post

[Jordan Brennan](https://hashnode.com/@jfbrennan)

[May 18, 2023](https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a/comment/6465b110eb43c7e4ebcfdd51)

Nice summary! I recently learned something new that you can do to avoid. a bunch of `document.getElementById()` calls. You can create a tiny Proxy and get a single object that effectively gives you direct access to every element with an id, like this:

```
// Given this HTML...
<h1 id="welcomeMessage" hidden>Welcome!</h1>

// Elements Proxy (make this a global, a module, or just add it to the top of your script)
const elements = new Proxy({}, {
  get(target, prop) {
    return document.getElementById(prop);
  }
});

elements.welcomeMessage.hidden = false;
```

[Harsh Kumar](https://hashnode.com/@coderharsh06)

[May 10, 2023](https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a/comment/645be35cddc45b5e40f77862)

To the point✅

[Nikhil Mishra](https://hashnode.com/@godnik)

[May 10, 2023](https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a/comment/645be35cddc45b5e40f77862#reply-645bea5f6085925e71f889d0)

Thanks harsh this blog is a part of the javascript series I am writing on you can check out the whole series.

[Parth Mandale](https://hashnode.com/@ParthMandale)

[May 10, 2023](https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a/comment/645bc737ddc45b5e40f775e2)

Nice one bhai!

[Nikhil Mishra](https://hashnode.com/@godnik)

[May 10, 2023](https://hashnode.com/posts/dom-manipulation-in-javascript/645b83b8f559ad8d059b600a/comment/645bc737ddc45b5e40f775e2#reply-645bea20ddc45b5e40f778e9)

Thanks bro
