# Empty content in HTML

**URL:** <https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064>\
**Category:** UXP Plugin API\
**Created:** [June 8, 2021, 9:58am UTC](https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064 "2021-06-08T09:58:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndreasResch](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/andreasresch/32/1423_2.png) [@AndreasResch](https://forums.creativeclouddeveloper.com/u/AndreasResch)\
**Post date:** [June 8, 2021, 9:58am UTC](https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064/1 "2021-06-08T09:58:06Z")

</div>

Hello.

Why are there empty objects between HTML elements everywhere where there are line breaks in the HTML file? This makes the use of the function “firstChild” pretty much impossible.

Here’s a screenshot to illustrate the issue …

 ![image](https://us1.discourse-cdn.com/flex015/uploads/xdplugins/original/2X/9/9b4dd66c8b1f8ca7c4bb941ceb687297eeaa3524.png)

As you can see the the call “document.getElementById(“panel\_presets”).firstChild” delivers an empty string instead of the “sp-label”-object.

---

<div class="post-metadata">

**Author:** ![AnthonyK](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AnthonyK](https://forums.creativeclouddeveloper.com/u/AnthonyK)\
**Post date:** [June 8, 2021, 9:19pm UTC](https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064/2 "2021-06-08T21:19:33Z")

</div>

Not an expert in this, but maybe you want “firstElementChild” instead of “firstChild”

---

<div class="post-metadata">

**Author:** ![kerrishotts](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/kerrishotts/32/8_2.png) [@kerrishotts](https://forums.creativeclouddeveloper.com/u/kerrishotts)\
**Post date:** [June 9, 2021, 2:45am UTC](https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064/3 "2021-06-09T02:45:32Z")

</div>

You’re seeing some of the whitespace in your HTML file being added as text nodes. If you want to be sure that you’re getting an element, be sure to use the `Element`-specific methods – otherwise you can end up with a `Node` instead.

---

<div class="post-metadata">

**Author:** ![AndreasResch](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.creativeclouddeveloper.com/andreasresch/32/1423_2.png) [@AndreasResch](https://forums.creativeclouddeveloper.com/u/AndreasResch)\
**Post date:** [June 9, 2021, 3:09pm UTC](https://forums.creativeclouddeveloper.com/t/empty-content-in-html/3064/4 "2021-06-09T15:09:17Z")

</div>

It seems as if line breaks and tabulators are displayed in the HTML view, which is very unusual and distracting. That wasn’t the case in CEP. Maybe this should be fixed.
