HTML::O...:Button(3)
π NAME π
ok so bestie, gather round: HTML::Object::DOM::Element::Button β that's the HTML Object DOM Button Class, the whole entire vibe for handling <button> elements. and yes it lives in section 3 of the manual, like all the Perl module pages do. π
β¨ SYNOPSIS β¨
like, literally all you need to start:
use HTML::Object::DOM::Element::Button;
my $button = HTML::Object::DOM::Element::Button->new ||
die( HTML::Object::DOM::Element::Button->error, "\n" );
that's it, that's the whole ritual π«Ά
πΈ VERSION πΈ
v0.2.0
(periodt. that's the one you're on.)
π¦ DESCRIPTION π¦
so this interface hands you all the properties and methods you need for manipulating <button> elements β and that's on top of the regular HTML::Object::Element interface, which it also gets by inheritance. so like... it already ate, and now it's eating again π
π INHERITANCE π
the whole family tree, no cap:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Button |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
look at that lineage. main character energy all the way down the chain. β
π§ PROPERTIES π§
it inherits properties from its parent HTML::Object::DOM::Element β so everything the parent has, this one has too, iykyk.
π accessKey
a string, and it's the single-character keyboard key that gives access to the button.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/accessKey
π autofocus
a boolean β says whether or not the control should have input focus when the page loads. unless the user overrides it, for example by typing in a different control. and heads up: only one form-associated element in a document can have this attribute specified. one. single. icon. π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/autofocus
π disabled
a boolean β says whether or not the control is disabled, which means it does not accept any clicks. blocked. no entry. π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/disabled
π form
Read-only.
it's a HTML::Object::DOM::Element::Form reflecting the form that this button is associated with. so: if the button is a descendant of a form element, then this property is the object of that form element. if the button is not a descendant of a form element, then the property can be the object of any form element in the same document that it's related to β or the "undef" value if none matches. it's giving "it's complicated" π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/form
π formAction
a string reflecting the URI of a resource that processes information submitted by the button. and if it's specified, this property overrides the action attribute of the <form> element that owns this element. it said "my rules now" π₯
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formAction
π formEnctype
a string reflecting the type of content that's used to submit the form to the server. if specified, this property overrides the enctype attribute of the <form> element that owns this element.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formEnctype
π formMethod
a string reflecting the HTTP method that the browser uses to submit the form. if specified, this property overrides the method attribute of the <form> element that owns this element.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formMethod
π formNoValidate
a boolean β says the form is not to be validated when it's submitted. if specified, this property overrides the novalidate attribute of the <form> element that owns this element. skipping the vibe check, honestly π«£
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formNoValidate
π formTarget
a string reflecting a name or keyword indicating where to display the response received after submitting the form. if specified, this property overrides the target attribute of the <form> element that owns this element.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/formTarget
π labels
Read-only.
it's a NodeList representing a list of <label> elements that are labels for this button. cute little entourage πΈ
Example:
<label id="label1" for="test">Label 1</label>
<button id="test">Button</button>
<label id="label2" for="test">Label 2</label>
$doc->addEventListener( load => sub
{
my $button = $doc->getElementById("test");
for( my $i = 0; $i < $button->labels->length; $i++ )
{
say( $button->labels->[$i]->textContent ); # "Label 1" and "Label 2"
}
});
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/labels
π menu
a HTML::Object::DOM::Element::Menu representing the menu element to be displayed if the button is clicked and is of type="menu".
β οΈ be careful, bestie: you cannot use this as an lvalue method. so the only way you can write it is:
$button->menu( $menu_object );
that's it. that's the only move. no cap.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/menu
π name
a string representing the name of the object when submitted with a form. and if it's specified, it must not be the empty string. empty string? not on this button's watch. π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/name
π tabIndex
a long that represents this element's position in the tabbing order. know your rank, queen π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/tabIndex
π type
a string indicating the behavior of the button. it's an enumerated attribute, so these are the possible values:
submitβ the button submits the form. this is the default value if the attribute isn't specified, or if it's dynamically changed to an empty or invalid value.resetβ the button resets the form.buttonβ the button does nothing. truly the "no thoughts head empty" option πmenuβ the button displays a menu.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/type
π validationMessage
Read-only.
a string representing the localized message describing the validation constraints that the control does not satisfy (if any). this attribute is the empty string if the control isn't a candidate for constraint validation (willValidate is false), or if it satisfies its constraints. so either you're valid or you're not even in the running π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/validationMessage
π validity
Read-only.
a ValidityState object representing the validity states that this button is in.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/validity
π value
a string representing the current form control value of the button.
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/value
π willValidate
Read-only.
a boolean indicating whether the button is a candidate for constraint validation. it's false if any conditions bar it from constraint validation, including: its type property is reset or button; it has a <datalist> ancestor; or the disabled property is set to true. three strikes and you're out of the validation lineup π
See also Mozilla documentation https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement/willValidate
π METHODS π
it inherits methods from its parent HTML::Object::DOM::Element. that's the whole methods section, bestie β the inheritance is carrying the team π«Ά
π AUTHOR π
Jacques Deguest <jack@deguest.jp>
π₯ SEE ALSO π₯
- Mozilla documentation
https://developer.mozilla.org/en-US/docs/Web/API/HTMLButtonElement - Mozilla documentation on button element
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button
β 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.
okay that's the whole page!! π this was HTML::O...:Button(3) from the User Contributed Perl Documentation, running on perl v5.42.2, dated 2026-02-15 β mwah, slay, go forth and press buttons responsibly πβ¨π
π¦ 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