HTML::O...t::Area(3)

πŸ“¦ version 0.6.0, in alpine 3.24

🌸 NAME 🌸

HTML::Object::DOM::Element::Area β€” HTML Object DOM Area Class. This is the HTML::Object::DOM::Element::Area(3) manual page, from User Contributed Perl Documentation. πŸ’–

🌈 SYNOPSIS 🌈

use HTML::Object::DOM::Element::Area;
my $area = HTML::Object::DOM::Element::Area->new ||
    die( HTML::Object::DOM::Element::Area->error, "\n" );

πŸŽ€ VERSION πŸŽ€

Vibe check, bestie: this page is at version v0.2.0.

v0.2.0

✨ DESCRIPTION ✨

Okay so bestie, this interface is serving special properties and methods β€” and yes, beyond the ones the regular object HTML::Object::Element interface already has available to it by inheritance β€” all for manipulating the layout and presentation of "<area"> elements. It's giving dedicated area-element energy. ✨

πŸ¦‹ INHERITANCE πŸ¦‹

The ancestry is iconic, no cap β€” this chain ate:

+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +----------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Area |
+-----------------------+     +---------------------------+     +-------------------------+     +----------------------------+     +----------------------------------+

πŸ’… PROPERTIES πŸ’…

Inherits properties from its parent HTML::Object::DOM::Element.

Every property below is part of the area element's main character era, fr fr:

πŸ“ accessKey πŸ“

This is a string containing a single character that switches input focus to the control. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/accessKey.

πŸ¦‹ alt πŸ¦‹

This is a string that reflects the alt HTML attribute, containing alternative text for the element. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/alt.

🌸 coords 🌸

This is a string that reflects the coords HTML attribute, containing coordinates to define the hot-spot region. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/coords.

πŸŽ€ download πŸŽ€

This is a string indicating that the linked resource is intended to be downloaded rather than displayed in the browser. The value represents the proposed name of the file. If the name is not a valid filename of the underlying OS, the browser will adapt it. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/download.

🧚 hash 🧚

This is a string containing the fragment identifier (including the leading hash mark (#)), if any, in the referenced URL. Example:

<map name="infographic">
    <area id="circle" shape="circle" coords="130,136,60"
    href="https://example.org/#ExampleSection" alt="Documentation" />
</map>

<img usemap="#infographic" src="/some/where/info.png" alt="Infographic" />

my $area = $doc->getElementById('circle');
$area->hash; # returns '#ExampleSection'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/hash.

πŸ”₯ host πŸ”₯

This is a string containing the hostname and port (if it's not the default port) in the referenced URL. Example:

my $area = $doc->createElement('area');

$area->href = 'https://example.org/some/where';
$area->host == 'example.org';

$area->href = "https://example.org:443/some/where";
$area->host == 'example.org';
# The port number is not included because 443 is the scheme's default port

$area->href = "https://example.org:4097/some/where";
$area->host == 'example.org:4097';

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/host.

πŸ’œ hostname πŸ’œ

This is a string containing the hostname in the referenced URL. Example:

# An <area id="myArea" href="https://example.org/some/where"> element is in the document
my $area = $doc->getElementById('myArea');
$area->hostname; # returns 'example.org'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/hostname.

🌈 href 🌈

This is a string that reflects the href HTML attribute, containing a valid URL of a linked resource. Example:

# An <area id="myArea" href="https://example.org/some/where"> element is in the document
my $area = $doc->getElementById("myArea");
$area->href; # returns 'https://example.org/some/where'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/href.

πŸ‘‘ noHref πŸ‘‘

This is a boolean flag indicating if the area is inactive (true) or active (false). This is an HTML attribute. Example:

<map name="SampleMap">
    <area shape="rect" coords="1,1,83,125" alt="rectangle" nohref="">
    <area shape="circle" coords="234,57,30" alt="circle" href="#">
    <area shape="poly" coords="363,37,380,40,399,35,420,47,426,63,423,78,430,94,409,90,395,92,379,84,371,67,370,57" alt="polygon" href="#">
</map>

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/noHref.

πŸ’– origin πŸ’–

Read-only.

Returns a string containing the origin of the URL, that is its scheme, its domain and its port. Example:

# An <area id="myArea" href="https://example.org/some/where"> element is in the document
my $area = $doc->getElementById("myArea");
$area->origin; # returns 'https://example.org'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/origin.

🫢 password 🫢

This is a string containing the password specified before the domain name. Example:

# An <area id="myArea" href="https://anonymous:flabada@example.org/some/where"> is in the document
my $area = $doc->getElementByID("myArea");
$area->password; # returns 'flabada'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/password.

🌟 pathname 🌟

This is a string containing the path name component, if any, of the referenced URL. Example:

# An <area id="myArea" href="/some/where"> element is in the document
my $area = $doc->getElementById("myArea");
$area->pathname; # returns '/some/where'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/pathname.

πŸ“ port πŸ“

This is a string containing the port component, if any, of the referenced URL. Example:

# An <area id="myArea" href="https://example.org:443/some/where"> element is in the document
my $area = $doc->getElementByID("myArea");
$area->port; # returns '443'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/port.

πŸ¦‹ protocol πŸ¦‹

This is a string containing the protocol component (including the trailing colon ':'), of the referenced URL. Example:

# An <area id="myArea" href="https://example.org/some/where"> element is in the document
my $area = $doc->getElementById("myArea");
$area->protocol; # returns 'https:'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/protocol.

🌸 referrerPolicy 🌸

This is a string that reflects the referrerpolicy HTML attribute indicating which referrer to use when fetching the linked resource. Example:

<img usemap="#mapAround" width="100" height="100" src="/img/logo@2x.png" />
<map id="myMap" name="mapAround" />>

my $elt = $doc->createElement("area");
$elt->href = "/img2.png";
$elt->shape = "rect";
$elt->referrerPolicy = "no-referrer";
$elt->coords = "0,0,100,100";
my $map = $doc->getElementById("myMap");

$map->appendChild($elt);
# When clicked, the area's link will not send a referrer header.

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/referrerPolicy.

πŸŽ€ rel πŸŽ€

This is a string that reflects the rel HTML attribute, indicating relationships of the current document to the linked resource. Example:

my $areas = $doc->getElementsByTagName("area");
my $length = $areas->length;
for( my $i = 0; $i < $length; $i++ )
{
    say("Rel: " + $areas->[$i]->rel);
}

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/rel.

🧚 relList 🧚

Returns a HTML::Object::TokenList that reflects the rel HTML attribute, indicating relationships of the current document to the linked resource, as a list of tokens. Example:

my $areas = $doc->getElementsByTagName("area");
my $length = $areas->length;

for( my $i = 0; $i < $length; $i++ )
{
    my $list = $areas->[$i]->relList;
    my $listLength = $list->length;
    say( "New area found." );
    for( my $j = 0; $j < $listLength; $j++ )
    {
        say( $list->[$j] );
    }
}

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/relList.

This is a string containing the search element (including leading question mark '?'), if any, of the referenced URL. Example:

# An <area id="myArea" href="/some/where?q=123"> element is in the document
my $area = $doc->getElementById("myArea");
$area->search; # returns '?q=123'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/search.

πŸ’… shape πŸ’…

This is a string that reflects the shape HTML attribute, indicating the shape of the hot-spot, limited to known values. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/shape.

🌈 tabIndex 🌈

This is a long containing the element's position in the tabbing order. Example:

my $b1 = $doc->getElementById('button1');
$b1->tabIndex = 1;

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/tabIndex.

πŸ‘‘ target πŸ‘‘

This is a string that reflects the target HTML attribute, indicating the browsing context in which to open the linked resource. See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/target.

πŸ’œ username πŸ’œ

This is a string containing the username specified before the domain name. Example:

# An <area id="myArea" href="https://anonymous:flabada@example.org/some/where"> element is in the document
my $area = $doc->getElementByID("myArea");
$area->username; # returns 'anonymous'

See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/username.

✨ METHODS ✨

okay so bestie, this class inherits methods from its parent HTML::Object::DOM::Element β€” slay, no cap. πŸ’…

πŸŽ€ toString πŸŽ€

toString returns a string containing the whole URL of the script executed in the Worker. It is a synonym for "href" in HTML::Object::DOM::Element::Area. the way that’s literally just the URL reveal ✨

Example:

# An <area id="myArea" href="/some/where"> element is in the document
my $area = $doc->getElementById("myArea");
$area->toString(); # returns 'https://example.org/some/where'

See also Mozilla documentation at https://developer.mozilla.org/en-US/docs/Web/API/HTMLAreaElement/toString πŸ¦‹

🌸 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.

πŸ’– source/version: perl v5.42.2 Β· date: 2026-02-15 β€” byeee bestie, go be iconic! 🫢✨

πŸ“¦ where this page comes from