HTML::O...t::Label(3)
π NAME
okay so bestie, gather round: HTML::Object::DOM::Element::Label β the HTML Object DOM Label Class. it's the whole vibe for <label> elements. periodt. π
β¨ SYNOPSIS
use HTML::Object::DOM::Element::Label;
my $label = HTML::Object::DOM::Element::Label->new ||
die( HTML::Object::DOM::Element::Label->error, "\n" );
like, that's literally it. construct it, or die trying (with the error message, obviously) π
πΈ VERSION
v0.2.0
she's v0.2.0 and she's serving π«Ά
π¦ DESCRIPTION
okay so this interface gives you access to the properties that are specific to <label> elements β like, the stuff that's just for labels, not for every element ever. it inherits methods and properties from the base HTML::Object::Element interface, because of course it does, family tree and all that π
π INHERITANCE
the glow-up lineage, in all its glory β read it left to right, babes:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Label |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +-----------------------------------+
she's at the end of the chain and she ate π
π₯ PROPERTIES
inherits properties from its parent HTML::Object::DOM::Element β yeah yeah, we know, mother provides π
π control
read-only, bestie.
it's a HTML::Object::Element representing the control that this label is associated with. it returns "undef" if the "for" attribute has no id set, or if no associated element could be found in the DOM. no cap β sometimes the control just isn't there and you get undef, that's the deal π«
see also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control>
π form
read-only too, obviously.
it's a HTML::Object::DOM::Element::Form object representing the form that the labeled control is associated with β or "undef" if there's no associated control, or if that control isn't associated with a form. like, if there's no control, there's no form to speak of, right? π€·ββοΈ
in other words, it's just a shortcut for:
$e->control->form
see also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/form>
β htmlFor
it's a string containing the ID of the labeled control β this reflects the for attribute. iykyk, it's the for attribute's whole personality β¨
example:
<label for="inputId">Enter your name</label>
my $label = $doc->getElementsByTagName( 'label' )->first;
say( "ID is: ", $label->htmlFor );
see also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/htmlFor>
π METHODS
inherits methods from its parent HTML::Object::DOM::Element β again, mother provides, we don't reinvent the wheel here π§
π AUTHOR
Jacques Deguest <jack@deguest.jp> β shoutout to the icon who wrote this π«Ά
π SEE ALSO
- Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement>
- Mozilla documentation on label element <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label>
- W3C specificatins <https://html.spec.whatwg.org/multipage/forms.html#htmllabelelement>
go read the docs, bestie, they're literally right there π
πΈ COPYRIGHT & LICENSE
Copyright(c) 2021 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.
like, fr fr, it's free software β use it, share it, remix it, just keep the same terms as Perl itself and we're all good π
and that's the whole page, babe β she's perl v5.42.2, dated 2026-02-15, and she's iconic. mwah ππ
π¦ 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