HTML::O...:Button(3)

πŸ“¦ version 0.6.0, in alpine 3.24

πŸ’– 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

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 πŸ”₯


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