HTML::O...emplate(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’… NAME

okay so this is HTML::Object::DOM::Element::Template β€” the HTML Object DOM Template Class, bestie. it's giving "i hold your template contents" and honestly? iconic. πŸŽ€


✨ SYNOPSIS ✨

use HTML::Object::DOM::Element::Template;
my $template = HTML::Object::DOM::Element::Template->new ||
    die( HTML::Object::DOM::Element::Template->error, "\n" );

that's it, that's the whole vibe. construct it, or die with the error and a newline. no cap. 🫢


🌸 VERSION 🌸

v0.2.0

literally right there. πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

so this interface is your ✨access pass✨ to the contents of an HTML template element. that's the whole thing. it's the little doorway into what's inside the <template>. obsessed. πŸ”₯


πŸ‘‘ INHERITANCE πŸ‘‘

the family tree, and it is long. look at all these ancestors, main character energy at every single level:

+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +--------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Template |
+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +--------------------------------------+

🧚 PROPERTIES 🧚

it inherits properties from its parent, HTML::Object::DOM::Element. slay. πŸ’…

πŸ“ content

read-only. like, fully read-only, don't even try it. πŸ™ˆ

it's a read-only DocumentFragment which contains the DOM subtree representing the <template> element's template contents.

example time, bestie:

my $templateElement = $doc->querySelector('#foo');
my $documentFragment = $templateElement->content->cloneNode(1); # pass true to cloneNode

(and yes, # pass true to cloneNode is a real comment β€” pass true to cloneNode, iykyk ✨)

also see the Mozilla documentation: <https://developer.mozilla.org/en-US/docs/Web/API/HTMLTemplateElement/content>


🌈 METHODS 🌈

it inherits methods from its parent, HTML::Object::DOM::Element. that's the whole section, we love a short king. πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Jacques Deguest <jack@deguest.jp>

the icon who made this happen. periodt. ⭐


πŸ”₯ SEE ALSO πŸ”₯

go read them, they're lowkey essential. πŸ“š


Copyright(c) 2022 DEGUEST Pte. Ltd.

All rights reserved

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


ok that's the legal bit, read it, respect it, don't be weird about it. πŸ’€

and that's a wrap bestie!! πŸ’–βœ¨ this page came from perl v5.42.2, dated 2026-02-15 β€” so go forth and template responsibly. mwah πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from