HTML::O...t::Body(3)
π HTML::Object::DOM::Element::Body β bestie edition π
okay so this page is all about HTML::Object::DOM::Element::Body, the HTML Object DOM Body Class π«Ά (yes, it's Perl, yes it's a DOM, yes we're doing this).
β¨ SYNOPSIS β¨
use HTML::Object::DOM::Element::Body;
my $body = HTML::Object::DOM::Element::Body->new ||
die( HTML::Object::DOM::Element::Body->error, "\n" );
like, that's literally it. new it or die trying, no cap π
πΈ VERSION πΈ
v0.2.0
π¦ INHERITANCE π¦
so the whole family tree goes like this, and honestly the way that chain ate:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Body |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
β¨ DESCRIPTION β¨
The HTML::Object::DOM::Element::Body interface is here to serve π β it gives you special properties (like, on top of the ones it already inherits from the regular HTML::Object::DOM::Element interface) for manipulating <body> elements. that's the whole vibe. body stuff. iconic.
π PROPERTIES π
Inherits properties from its parent HTML::Object::DOM::Element. periodt.
π OBSOLETE PROPERTIES π
ngl bestie, these are deprecated β and all of them literally just return undef π
aLinkβ a string representing the color of active hyperlinks. iykyk.backgroundβ a string representing the description of the location of the background image resource. β οΈ heads up: this is not an URI, though some older version of some browsers do expect it. (yes, fr fr, that's the actual caveat.)bgColorβ a string representing the background color for the document.linkβ a string representing the color of unvisited links.textβ a string representing the foreground color of text.vLinkβ a string representing the color of visited links.
and each one has its own Mozilla documentation link, because of course:
aLinkβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/aLink>backgroundβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/background>bgColorβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/bgColor>linkβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/link>textβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/text>vLinkβ <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/vLink>
π METHODS π
Inherits methods from its parent HTML::Object::DOM::Element. that's the tea π
π₯ EVENT HANDLERS π₯
Below are the event handlers you can use that are implemented in this interface. BUT β and this is the important part, bestie β it is up to you to fire those related events. the library is not gonna do it for you, no cap π
π onafterprint
Is an event handler representing the code to be called when the afterprint event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onafterprint>
π onbeforeprint
Is an event handler representing the code to be called when the beforeprint event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeprint>
π onbeforeunload
Is an event handler representing the code to be called when the beforeunload event is raised.
Example, slay:
use HTML::Object::DOM qw( window );
window->addEventListener( beforeunload => sub
{
# Cancel the event
# If you prevent default behavior in Mozilla Firefox prompt will always be shown
$e->preventDefault();
# Chrome requires returnValue to be set
$e->returnValue = '';
});
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload>
π onhashchange
Is an event handler representing the code to be called when the hashchange event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onhashchange>
π onlanguagechange
Is an event handler representing the code to be called when the languagechange event is raised.
Example:
object->onlanguagechange = function;
window->onlanguagechange = sub
{
say( 'languagechange event detected!' );
};
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onlanguagechange>
π onmessage
Is an event handler called whenever an object receives a message event.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onmessage>
π onmessageerror
Is an event handler called whenever an object receives a messageerror event.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onmessageerror>
π onoffline
Is an event handler representing the code to be called when the offline event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/onoffline>
π ononline
Is an event handler representing the code to be called when the online event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/ononline>
π onpagehide
Is an event handler representing the code to be called when the pagehide event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/onpagehide>
π onpageshow
Is an event handler representing the code to be called when the pageshow event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement/onpageshow>
π onpopstate
Is an event handler representing the code to be called when the popstate event is raised.
Example β this one's a whole mini saga, bestie:
window->onpopstate = sub
{
my $event = shift( @_ );
say( "location: " . $doc->location . ", state: " . JSON->new->encode( $event->state ) );
};
$history->pushState({page => 1}, "title 1", "?page=1");
$history->pushState({page => 2}, "title 2", "?page=2");
$history->replaceState({page => 3}, "title 3", "?page=3");
$history->back(); # alerts "location: https://example.org/example.html?page=1, state => {"page" => 1}"
$history->back(); # alerts "location: https://example.org/example.html, state: null
$history->go(2); # alerts "location: https://example.org/example.html?page=3, state => {"page" =>3}
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate>
π onrejectionhandled
An event handler representing the code executed when the rejectionhandled event is raised, indicating that a Promise was rejected and the rejection has been handled. π closure, we love to see it.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onrejectionhandled>
π onresize
Is an event handler representing the code to be called when the resize event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/onresize>
π onstorage
Is an event handler representing the code to be called when the storage event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onstorage>
π onunhandledrejection
An event handler representing the code executed when the unhandledrejection event is raised, indicating that a Promise was rejected but the rejection was not handled. π the drama of it all.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunhandledrejection>
π onunload
Is an event handler representing the code to be called when the unload event is raised.
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onunload>
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β king behavior, honestly π
π§ SEE ALSO π§
- Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLBodyElement>
- Mozilla documentation on anchor element <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/body>
β COPYRIGHT & LICENSE β
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.
and that's the page, bestie π this doc shipped as perl v5.42.2, dated 2026-02-15, and yes we're crediting the perl manpage family for the whole HTML::O...t::Body(3) glow-up. go forth and manipulate those <body> elements π¦πΈπ
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms