HTML::O...extArea(3)

πŸ“¦ version 0.6.0, in alpine 3.24

🌸 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 πŸ¦‹

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