Actual hidden properties on HTML elements – what is the correct term?

I've known about this for a while, but I'm not exactly sure what it's called:

var el = document.createElement("p");
el.innerText = "Hello";
el.loremipsum = "TEST STRING"; <-- THIS

document.body.appendChild(el);

If I inspect the DOM, this is what I get:

<p>Hello</p>

The loremipsum property is not in the DOM, but:

document.querySelector("p").loremipsum

returns "TEST STRING". What is this property manipulation called? I would like to research it a bit. And yes, I know data attributes are better to use.



Read more here: https://stackoverflow.com/questions/64955732/actual-hidden-properties-on-html-elements-what-is-the-correct-term

Content Attribution

This content was originally published by MortenMoulder at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: