The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

HTML::Object::DOM::Element::Output - HTML Object DOM Output Class

SYNOPSIS

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

VERSION

    v0.2.0

DESCRIPTION

This interface provides properties and methods (beyond those inherited from HTML::Object::Element) for manipulating the layout and presentation of <output> elements.

INHERITANCE

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

PROPERTIES

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

defaultValue

A string representing the default value of the element, initially the empty string.

See also Mozilla documentation

form

Read-only.

An HTML::Object::DOM::Element::Form indicating the form associated with the control, reflecting the form HTML attribute if it is defined.

Example:

    <form
        action="/action_page.php"
        id="numform"
        oninput="x.value=parseInt(a.value)+parseInt(b.value)">
        <input type="range" id="a" name="a" value="50" />
        + <input type="number" id="b" name="b" value="25" />
        <input type="submit" />
    </form>

    <output form="numform" id="x" name="x" for="a b"></output> 

See also Mozilla documentation

htmlFor

Read-only.

A TokenList reflecting the for HTML attribute, containing a list of IDs of other elements in the same document that contribute to (or otherwise affect) the calculated value.

See also Mozilla documentation

labels

Read-only.

Returns a HTML::Object::DOM::NodeList of <label|HTML::Object::DOM::Element::Label> elements associated with the element.

Example:

    <label id="label1" for="test">Label 1</label>
    <output id="test">Output</output>
    <label id="label2" for="test">Label 2</label>

    use HTML::Object::DOM qw( window );
    window->addEventListener( DOMContentLoaded => sub
    {
        my $output = $doc->getElementById( 'test' );
        for( my $i = 0; $i < $output->labels->length; $i++ )
        {
            say( $output->labels->[$i]->textContent ); # "Label 1" and "Label 2"
        }
    });

See also Mozilla documentation

name

A string reflecting the name HTML attribute, containing the name for the control that is submitted with form data.

See also Mozilla documentation

type

Normally this is read-only, but under perl you can set whatever string value you want. By default the value is output.

Under JavaScript, this is a read-only property that returns the string output.

See also Mozilla documentation

validationMessage

Read-only.

A string representing a localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.

See also Mozilla documentation

validity

Read-only.

A ValidityState representing the validity states that this element is in.

See also Mozilla documentation

value

A string representing the value of the contents of the elements. Behaves like the "textContent" in HTML::Object::DOM::Node property.

See also Mozilla documentation

willValidate

Read-only.

A boolean value indicating whether the element is a candidate for constraint validation.

See also Mozilla documentation

METHODS

Inherits methods from its parent HTML::Object::DOM::Element

checkValidity

Checks the validity of the element and returns a boolean value holding the check result.

See also Mozilla documentation

reportValidity

This method reports the problems with the constraints on the element, if any, to the user. If there are problems, fires an invalid event at the element, and returns false; if there are no problems, it returns true. When the problem is reported, the user agent may focus the element and change the scrolling position of the document or perform some other action that brings the element to the user's attention. User agents may report more than one constraint violation if this element suffers from multiple problems at once. If the element is not rendered, then the user agent may report the error for the running script instead of notifying the user.

See also Mozilla documentation

setCustomValidity

Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.

See also Mozilla documentation

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation, Mozilla documentation on output element

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.