Coding is as much a matter of personal growth as it is of logic and control-flow. I keep patience, curiosity, & exuberance in the same toolbox as vim and git.
*Opinions posted are my own*
content is a read-only property on HTMLTemplateElement that's not provided on other elements. It's purpose is to give you a handle on the template's contents as a DocumentFragment, so that you can clone it.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Benny I've never seen the element method .content from const
clone = template.content.cloneNode(true);
Is this new or just something thats always been available?
Hey Eric thanks for dropping by 🍻
content is a read-only property on
HTMLTemplateElement
that's not provided on other elements. It's purpose is to give you a handle on the template's contents as a DocumentFragment, so that you can clone it.