# Elements Language Comment Statement

**URL:** <https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061>\
**Category:** Elements\
**Created:** [April 7, 2025, 3:25pm UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061 "2025-04-07T15:25:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [April 7, 2025, 3:25pm UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061/1 "2025-04-07T15:25:34Z")

</div>

It would be useful to have a comment feature added to the Elements Language, for example:

```auto
@@ This is a comment about the code below!
@if(switch)
<div>This is a Div</div>
@endif

```

I am not clear whether you can add comments to @if, @endif etc ? 🙂

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [April 7, 2025, 4:57pm UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061/2 "2025-04-07T16:57:14Z")

</div>

Maybe I’m missing something… but why not just use HTML comments?

```auto
<!-- This is an HTML comment about the code below! -->
@if(switch)
  <div>This is a Div</div>
@endif

```

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [April 7, 2025, 5:00pm UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061/3 "2025-04-07T17:00:06Z")

</div>

@dan ,  
Yes you can but then it gets output with the HTML. I was looking not to have the comment published to the website. I could hid a comment with PHP but seems somewhat counter-intuitive?

---

<div class="post-metadata">

**Author:** ![tpbradley](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/tpbradley/32/25503_2.png) [@tpbradley](https://forums.realmacsoftware.com/u/tpbradley)\
**Post date:** [April 8, 2025, 10:08pm UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061/4 "2025-04-08T22:08:16Z")

</div>

You could use an if statement for now. It’s not as elegant as a comment but it’ll work.

```auto
@if(comment) This is an HTML comment about the code below! @endif
@if(switch)
  <div>This is a Div</div>
@endif

```

Because the `comment` property doesn’t exist, it’ll evaluate to false and never output the comment text.

---

<div class="post-metadata">

**Author:** ![ben](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ben/32/28488_2.png) [@ben](https://forums.realmacsoftware.com/u/ben)\
**Post date:** [April 9, 2025, 7:20am UTC](https://forums.realmacsoftware.com/t/elements-language-comment-statement/47061/5 "2025-04-09T07:20:45Z")

</div>

> [@logrunner](#):
>
> I was looking not to have the comment published to the website

you could also check if you’re in edit mode:

```html
@if(edit)
  <!-- This is my comment for edit mode only -->
@endif

```
