# Help with property {{msg.property}}

**URL:** https://discourse.nodered.org/t/help-with-property-msg-property/64183
**Category:** General
**Tags:** node-red-dashboard
**Created:** [20 June 2022 18:38 UTC](https://discourse.nodered.org/t/help-with-property-msg-property/64183 "2022-06-20T18:38:00Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![mojgithub](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojgithub/32/63532_2.png) [@mojgithub](https://discourse.nodered.org/u/mojgithub)
#### Post date: [20 June 2022 18:38 UTC](https://discourse.nodered.org/t/help-with-property-msg-property/64183/1 "2022-06-20T18:38:00Z")

</div>

Hi i am new here.

I have created in function node new property: msg.class = "class-active";

I am having trouble with calling this new property "msg.class" to different input fields in different nodes. Dont understand why it works for some fields and not for others.

Below is an example. I would like to set custom class for example text node. For label it is not problem but for class it shows {{msg.class}} instead of "class-active"

 ![property](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c62b2cfd887676cfca47c714ebbf86f15d88d8e.png)

---

<div class="post-metadata">

### Author: ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)
#### Post date: [20 June 2022 19:49 UTC](https://discourse.nodered.org/t/help-with-property-msg-property/64183/2 "2022-06-20T19:49:44Z")

</div>

I dont think the mustache {{ msg.class }} syntax is supported for the class field.

At the end of the Help tab for the node :

> If a **Class** is specified, it will be added to the parent card. This way you can style the card and the elements inside it with custom CSS. The Class can be set at runtime by setting a `msg.className` string property.

So if you want to dynamically set a class use `msg.className` instead

---

<div class="post-metadata">

### Author: ![mojgithub](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/mojgithub/32/63532_2.png) [@mojgithub](https://discourse.nodered.org/u/mojgithub)
#### Post date: [20 June 2022 20:17 UTC](https://discourse.nodered.org/t/help-with-property-msg-property/64183/3 "2022-06-20T20:17:57Z")

</div>

> [@UnborN](#):
>
> `className`

tnx it works

---

<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: [4 July 2022 20:18 UTC](https://discourse.nodered.org/t/help-with-property-msg-property/64183/4 "2022-07-04T20:18:15Z")

</div>

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