The manakai project

Web::DOM::HTMLElement

DOM HTMLElement object

DESCRIPTION

The Web::DOM::HTMLElement class implements the DOM HTMLElement interface. This class is used by elements in the HTML namespace.

METHODS

In addition to the methods available for the Web::DOM::Element class, following methods are available:

$string = $el->accesskey
$el->accesskey ($string)

Return or set the accesskey attribute. [HTML]

$string = $el->contenteditable
$el->contenteditable ($string)

Return or set the contenteditable attribute. [HTML]

$map = $el->dataset

Return the Web::DOM::StringMap object represeting the data-* attributes. [HTML]

$string = $el->dir
$el->dir ($string)

Return or set the dir attribute. [HTML]

$boolean = $el->draggable
$el->draggable ($boolean)

Return or set whether the element is draggable or not. [HTML]

$tokens = $el->dropzone
$el->dropzone ($string)

Return the Web::DOM::TokenList object for the dropzone attribute, or set the dropzone attribute to the specified string value. [HTML]

$boolean = $el->hidden
$el->hidden ($boolean)

Return or set whether the hidden attribute is specified or not. [HTML]

For example:

  $el = $doc->create_element ('span')
  ok not $el->hidden; # <span>
  $el->hidden (1);
  ok $el->hidden; # <span hidden>
$string = $el->inputmode
$el->inputmode ($string)

Return or set the inputmode attribute. [HTML]

$string = $el->itemid
$el->itemid ($string)

Return or set the itemid attribute. [HTMLMD]

$tokens = $el->itemprop
$el->itemprop ($string)

Return the Web::DOM::TokenList object for the itemprop attribute, or set the itemprop attribute to the specified string value. [HTMLMD]

$tokens = $el->itemref
$el->itemref ($string)

Return the Web::DOM::TokenList object for the itemref attribute, or set the itemref attribute to the specified string value. [HTMLMD]

$boolean = $el->itemscope
$el->itemscope ($boolean)

Return or set whether the itemscope attribute is specified or not. [HTMLMD]

$tokens = $el->itemtype
$el->itemtype ($string)

Return the Web::DOM::TokenList object for the itemtype attribute, or set the itemtype attribute to the specified string value. [HTMLMD]

$value = $el->itemvalue
$el->itemvalue ($value)

Get or set the value of the property of the item, represented by the element. [HTMLMD]

$string = $el->lang
$el->lang ($string)

Return or set the lang attribute. [HTML]

For example:

  $el->lang ('ja');
  is $el->lang, 'ja';
  is $el->get_attribute ('lang'), 'ja';
$hashref = $el->manakai_get_properties

Return a hash reference of item properties, where hash keys are property names and hash values are array references of property elements. [MANAKAI] [DOMPERL]

See also "DEPENDENCY" in Web::DOM.

$style = $el->style

Return the Web::DOM::CSSStyleDeclaration object for the style attribute. [CSSOM]

$el->style ($string)

Set the style attribute. [CSSOM]

$string = $el->title
$el->title ($string)

Return or set the title attribute. [HTML]

Most HTML elements have their own subclasses. For example, any HTML p element uses the Web::DOM::HTMLParagraphElement class, while any HTML input element uses the Web::DOM::HTMLInputElement class. There are following subclasses:

Web::DOM::HTMLUnknownElement, Web::DOM::HTMLHtmlElement, Web::DOM::HTMLHeadElement, Web::DOM::HTMLTitleElement, Web::DOM::HTMLBaseElement, Web::DOM::HTMLLinkElement, Web::DOM::HTMLMetaElement, Web::DOM::HTMLStyleElement, Web::DOM::HTMLScriptElement, Web::DOM::HTMLBodyElement, Web::DOM::HTMLHeadingElement, Web::DOM::HTMLParagraphElement, Web::DOM::HTMLHRElement, Web::DOM::HTMLPreElement, Web::DOM::HTMLQuoteElement, Web::DOM::HTMLOListElement, Web::DOM::HTMLUListElement, Web::DOM::HTMLLIElement, Web::DOM::HTMLDListElement, Web::DOM::HTMLDivElement, Web::DOM::HTMLAnchorElement, Web::DOM::HTMLDataElement, Web::DOM::HTMLTimeElement, Web::DOM::HTMLSpanElement, Web::DOM::HTMLBRElement, Web::DOM::HTMLModElement, Web::DOM::HTMLImageElement, Web::DOM::HTMLIFrameElement, Web::DOM::HTMLEmbedElement, Web::DOM::HTMLObjectElement, Web::DOM::HTMLParamElement, Web::DOM::HTMLMediaElement, Web::DOM::HTMLVideoElement, Web::DOM::HTMLAudioElement, Web::DOM::HTMLSourceElement, Web::DOM::HTMLTrackElement, Web::DOM::HTMLCanvasElement, Web::DOM::HTMLMapElement, Web::DOM::HTMLAreaElement, Web::DOM::HTMLTableElement, Web::DOM::HTMLTableCaptionElement, Web::DOM::HTMLTableColElement, Web::DOM::HTMLTableSectionElement, Web::DOM::HTMLTableRowElement, Web::DOM::HTMLTableCellElement, Web::DOM::HTMLFormElement, Web::DOM::HTMLFieldSetElement, Web::DOM::HTMLLegendElement, Web::DOM::HTMLLabelElement, Web::DOM::HTMLInputElement, Web::DOM::HTMLButtonElement, Web::DOM::HTMLSelectElement, Web::DOM::HTMLDataListElement, Web::DOM::HTMLOptGroupElement, Web::DOM::HTMLOptionElement, Web::DOM::HTMLTextAreaElement, Web::DOM::HTMLOutputElement, Web::DOM::HTMLProgressElement, Web::DOM::HTMLMeterElement, Web::DOM::HTMLDetailsElement, Web::DOM::HTMLMenuElement, Web::DOM::HTMLDialogElement, Web::DOM::HTMLAppletElement, Web::DOM::HTMLMarqueeElement, Web::DOM::HTMLFrameSetElement, Web::DOM::HTMLFrameElement, Web::DOM::HTMLDirectoryElement, Web::DOM::HTMLFontElement, Web::DOM::HTMLTemplateElement, Web::DOM::HTMLSlotElement, Web::DOM::HTMLPictureElement.

Classes Web::DOM::HTMLBaseFontElement and Web::DOM::HTMLMenuItemElement are no longer available, as they are dropped from the HTML Standard.

SPECIFICATIONS

HTML

HTML Standard <https://html.spec.whatwg.org/>.

CSSOM

CSSOM <https://dev.w3.org/csswg/cssom/#elementcssinlinestyle>.

HTMLMD

HTML Microdata API <https://github.com/whatwg/html/commit/2aaecb89900b875b9ee8357fa8bccf48477358bb>.

MANAKAI

manakai DOM Extensions <https://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai++DOM%20Extensions>.

DOMPERL

manakai's DOM Perl Binding <https://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai%27s%20DOM%20Perl%20Binding>.

SEE ALSO

Web::DOM::Element.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2013-2019 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.