# How do I get the node ID in HTML

**URL:** <https://discourse.nodered.org/t/how-do-i-get-the-node-id-in-html/9107>\
**Category:** General\
**Created:** [18 March 2019 06:49 UTC](https://discourse.nodered.org/t/how-do-i-get-the-node-id-in-html/9107 "2019-03-18T06:49:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JiChen](https://avatars.discourse-cdn.com/v4/letter/j/e9c0ed/32.png) [@JiChen](https://discourse.nodered.org/u/JiChen)\
**Post date:** [18 March 2019 06:49 UTC](https://discourse.nodered.org/t/how-do-i-get-the-node-id-in-html/9107/1 "2019-03-18T06:49:00Z")

</div>

- How do I get the node ID in HTML  
 ![%E8%8A%82%E7%82%B9ID](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/de21ba856727e84adcc4fde708d7021e5b8c5014.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [18 March 2019 08:54 UTC](https://discourse.nodered.org/t/how-do-i-get-the-node-id-in-html/9107/2 "2019-03-18T08:54:14Z")

</div>

Hi @JiChen

where in your HTML do you want to get the node id? Is it in a node's `oneditprepare` or `oneditsave` function? If so, then `this.id` will be the id of the node being edited.

If you mean something else, you'll need to explain.
