HTML::O...extArea(3)
πΈ NAME πΈ
Bestie, welcome to the manual page for HTML::Object::DOM::Element::TextArea β the header shortens it to HTML::O...extArea(3), and it's filed under User Contributed Perl Documentation. This is the HTML Object DOM TextArea Class, and it's literally the main character for all things <textarea>. π
β¨ SYNOPSIS β¨
use HTML::Object::DOM::Element::TextArea;
my $textarea = HTML::Object::DOM::Element::TextArea->new ||
die( HTML::Object::DOM::Element::TextArea->error, "\n" );
π VERSION π
Version check, bestie: v0.2.0. Slay. β¨
π¦ DESCRIPTION π¦
This interface provides special properties and methods for manipulating the layout and presentation of <textarea> elements. It's giving textarea glow-up energy. π
π INHERITANCE π
The whole family tree is a whole runway walk:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::TextArea |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +--------------------------------------+
π§ PROPERTIES π§
Inherits properties from its parent HTML::Object::DOM::Element. That's it β inherited, iconic, no extra drama. π
π METHODS π
Inherits methods from its parent HTML::Object::DOM::Element. The methods are literally passing the vibe down the chain. π«Ά
π¬ EVENTS π¬
Event listeners for those events can also be found by prepending "on" before the event type:
"click" event listeners can be set also with "onclick" method:
$e->onclick(sub{ # do something });
# or as an lvalue method
$e->onclick = sub{ # do something };
π₯ input π₯
Fires when the value of an input, select, or textarea element has been changed.
Example:
<input placeholder="Enter some text" name="name"/>
<p id="values"></p>
my $input = $doc->querySelector('$input');
my $log = $doc->getElementById('values');
$input->addEventListener( input => \&updateValue );
sub updateValue
{
my $e = shift( @_ );
$log->textContent = $e->target->value;
}
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event>. That event link is a whole mood. π₯
π selectionchange π
Under perl, this does not do anything of course, but you can fire yourself the event.
Under JavaScript, this fires when the text selection in a textarea element has been changed.
Example:
<div>Enter and select text here:<br><textarea id="mytext" rows="2" cols="20"></textarea></div>
<div>selectionStart: <span id="start"></span></div>
<div>selectionEnd: <span id="end"></span></div>
<div>selectionDirection: <span id="direction"></span></div>
my $myinput = $doc->getElementById( 'mytext' );
$myinput->addEventListener( selectionchange => sub
{
$doc->getElementById( 'start' )->textContent = $mytext->selectionStart;
$doc->getElementById( 'end' )->textContent = $mytext->selectionEnd;
$doc->getElementById( 'direction' )->textContent = $mytext->selectionDirection;
});
See also Mozilla documentation <https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement/selectionchange_event>. Selection drama, but make it documented. π
π EVENT HANDLERS π
β oninput β
Property to handle event of type "input". Those events are not automatically fired, but you can trigger them yourself.
π onselectionchange π
Property to handle event of type "selectionchange". Those events are not automatically fired, but you can trigger them yourself.
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β the icon who wrote this. π
π¦ SEE ALSO π¦
- Mozilla documentation
<https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement> - Mozilla documentation on textarea element
<https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea>
π 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.
That's the whole page, bestie! Source/version: perl v5.42.2; date: 2026-02-15; page: HTML::O...extArea(3). Byeee π
π¦ 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