Empty content in HTML

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

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

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

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.

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.