HTML::HTML5::DOM::HTMLElement - implementation of the HTMLElement interface of the HTML DOM
HTML::HTML5::DOM::HTMLElement is an implementation of the HTMLElement interface of the HTML DOM. See HTML::HTML5::DOM for a list of the conventions that have been used when translating the DOM to Perl.
This class applies to the following HTML elements.
{http://www.w3.org/1999/xhtml}abbr
{http://www.w3.org/1999/xhtml}address
{http://www.w3.org/1999/xhtml}article
{http://www.w3.org/1999/xhtml}aside
{http://www.w3.org/1999/xhtml}b
{http://www.w3.org/1999/xhtml}bdi
{http://www.w3.org/1999/xhtml}bdo
{http://www.w3.org/1999/xhtml}cite
{http://www.w3.org/1999/xhtml}code
{http://www.w3.org/1999/xhtml}dd
{http://www.w3.org/1999/xhtml}dfn
{http://www.w3.org/1999/xhtml}dt
{http://www.w3.org/1999/xhtml}em
{http://www.w3.org/1999/xhtml}figcaption
{http://www.w3.org/1999/xhtml}figure
{http://www.w3.org/1999/xhtml}footer
{http://www.w3.org/1999/xhtml}header
{http://www.w3.org/1999/xhtml}hgroup
{http://www.w3.org/1999/xhtml}i
{http://www.w3.org/1999/xhtml}kbd
{http://www.w3.org/1999/xhtml}mark
{http://www.w3.org/1999/xhtml}nav
{http://www.w3.org/1999/xhtml}noscript
{http://www.w3.org/1999/xhtml}rp
{http://www.w3.org/1999/xhtml}rt
{http://www.w3.org/1999/xhtml}ruby
{http://www.w3.org/1999/xhtml}s
{http://www.w3.org/1999/xhtml}samp
{http://www.w3.org/1999/xhtml}section
{http://www.w3.org/1999/xhtml}small
{http://www.w3.org/1999/xhtml}strong
{http://www.w3.org/1999/xhtml}sub
{http://www.w3.org/1999/xhtml}summary
{http://www.w3.org/1999/xhtml}sup
{http://www.w3.org/1999/xhtml}u
{http://www.w3.org/1999/xhtml}var
{http://www.w3.org/1999/xhtml}wbr
HTML::HTML5::DOM::HTMLElement inherits methods from the following Perl classes.
XML::LibXML::Augment::Element
XML::LibXML::Augment::Node
XML::LibXML::Element
XML::LibXML::Node
XML::LibXML::QuerySelector
HTML::HTML5::DOMutil::FancyISA
As well as its inherited methods, this class provides the following methods.
accessKey
Called with no arguments, is a shortcut for $elem->getAttribute("accesskey"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("accesskey")
setAttribute
removeAttribute
classList
Splits $elem->getAttribute("class") into a list on whitespace.
$elem->getAttribute("class")
className
Called with no arguments, is a shortcut for $elem->getAttribute("class"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
compareDocumentPosition
Compares this node with another based on document order.
dataset
Gets a hashref based on data-foo attributes. This is currently read-only, but in future may be implemented as a tied hash to allow read/write access.
data-foo
dir
Called with no arguments, is a shortcut for $elem->getAttribute("dir"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("dir")
getElementById
The world-famous getElementById method. The default XML::LibXML implementation of this does not work with HTML::HTML5::Parser documents, because HTML::HTML5::Parser lacks the ability to inform libxml which element to use as an ID. (libxml defaults to xml:id.) This implementation is XPath-based, thus slower.
getElementsByClassName
Given one or more class names, returns a list of elements bearing those classes.
getFeature
Acts as a shortcut for $element->ownerDocument->implementation->getFeature.
$element->ownerDocument->implementation->getFeature
getUserData
Not implemented - perhaps never will be. Try dataset instead.
hidden
Called with no arguments, is a shortcut for $elem->hasAttribute("hidden"). If called with a true argument, will setAttribute; if called with a false argument will removeAttribute.
$elem->hasAttribute("hidden")
id
Called with no arguments, is a shortcut for $elem->getAttribute("id"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("id")
innerHTML
When called without arguments, serialises the contents of the element (but not the element itself) to a single string. When called with a string argument, parses the string as HTML and uses it to set the content of this element. When possible, attempts to use polyglot HTML (i.e. markup that works as HTML and XHTML).
isDefaultNamespace
Given a URI, returns true if that is the default namespace prefix.
isSupported
Acts as a shortcut for $element->ownerDocument->implementation->hasFeature.
$element->ownerDocument->implementation->hasFeature
lang
Called with no arguments, is a shortcut for $elem->getAttribute("lang"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("lang")
lookupPrefix
Alias for lookupNamespacePrefix.
lookupNamespacePrefix
outerHTML
As per innerHTML, but includes the element itself. Can be used as a setter, but that's a bit of a weird thing to do.
p5_ancestors
Returns a (Perl or XML::LibXML::NodeList) list of this element's ancestors - i.e. the parentNode, the parentNode of the parentNode, etc.
p5_contains
Given an argument, returns true if that argument is an element nested within this element.
schemaTypeInfo
Not implemented.
setIdAttribute
setIdAttributeNS
setIdAttributeNode
setUserData
tabIndex
Called with no arguments, is a shortcut for $elem->getAttribute("tabindex"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("tabindex")
title
Called with no arguments, is a shortcut for $elem->getAttribute("title"). Called with a defined argument, acts as setAttribute. Called with undef as an argument, acts as removeAttribute.
$elem->getAttribute("title")
translate
Called with no arguments, is a shortcut for $elem->hasAttribute("translate"). If called with a true argument, will setAttribute; if called with a false argument will removeAttribute.
$elem->hasAttribute("translate")
http://rt.cpan.org/Dist/Display.html?Queue=HTML-HTML5-DOM.
HTML::HTML5::DOM.
Toby Inkster <tobyink@cpan.org>.
This software is copyright (c) 2012, 2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install HTML::HTML5::DOM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::HTML5::DOM
CPAN shell
perl -MCPAN -e shell install HTML::HTML5::DOM
For more information on module installation, please visit the detailed CPAN module installation guide.