# How to access custom node label in html file

**URL:** <https://discourse.nodered.org/t/how-to-access-custom-node-label-in-html-file/36161>\
**Category:** General\
**Created:** [18 November 2020 18:43 UTC](https://discourse.nodered.org/t/how-to-access-custom-node-label-in-html-file/36161 "2020-11-18T18:43:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mathurv](https://avatars.discourse-cdn.com/v4/letter/m/e9a140/32.png) [@mathurv](https://discourse.nodered.org/u/mathurv)\
**Post date:** [18 November 2020 18:43 UTC](https://discourse.nodered.org/t/how-to-access-custom-node-label-in-html-file/36161/1 "2020-11-18T18:43:20Z")

</div>

Hi,  
I have seen the following code in core inject node (20-inject.html)

```auto
var label = this._def.label.call(this);

```

I would like to do the same in my custom node to access the node label. But... I am getting "\_def of undefined" error.

Tried another way that is in the same core inject node (20-inject.html).

```auto
var label = this._(name);
getting "_ of undefined" error

```

Can any please suggest what is wrong and how to fix it.

Thanks in advance

---

<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 November 2020 19:11 UTC](https://discourse.nodered.org/t/how-to-access-custom-node-label-in-html-file/36161/2 "2020-11-18T19:11:23Z")

</div>

Is this in your `oneditprepare` function? If so, how exactly have you defined the function?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [17 January 2021 19:11 UTC](https://discourse.nodered.org/t/how-to-access-custom-node-label-in-html-file/36161/3 "2021-01-17T19:11:34Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
