The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTML::Object::DOM::Element::Option - HTML Object DOM Option Class

SYNOPSIS

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

VERSION

    v0.2.0

DESCRIPTION

This interface represents <option> elements and inherits all properties and methods of the HTML::Object::Element interface.

INHERITANCE

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

PROPERTIES

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

defaultSelected

Has a value of either true or false that shows the initial value of the selected HTML attribute, indicating whether the option is selected by default or not.

See also Mozilla documentation

disabled

Has a value of either true or false representing the value of the disabled HTML attribute, which indicates that the option is unavailable to be selected. An option can also be disabled if it is a child of an <optgroup> element that is disabled.

See also Mozilla documentation

form

Read-only.

Is a HTML::Object::DOM::Element::Form representing the same value as the form of the corresponding <select> element, if the option is a descendant of a <select> element, or undef if none is found.

See also Mozilla documentation

index

Read-only.

Is a long representing the position of the option within the list of options it belongs to, in tree-order. If the option is not part of a list of options, like when it is part of the datalist element, the value is undef.

See also Mozilla documentation

label

Read-only.

Is a string that reflects the value of the label HTML attribute, which provides a label for the option. If this attribute is not specifically set, reading it returns the element's text content.

See also Mozilla documentation

selected

Has a value of either true or false that indicates whether the option is currently selected.

See also Mozilla documentation

text

Is a string that contains the text content of the element.

See also Mozilla documentation

value

Is a string that reflects the value of the value HTML attribute, if it exists; otherwise reflects value of the Node.textContent property.

See also Mozilla documentation

METHODS

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

AUTHOR

Jacques Deguest <jack@deguest.jp>

SEE ALSO

Mozilla documentation, Mozilla documentation on option 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.