localName property
The read-only localName
property of the Attr interface returns the
local part of the qualified name of an attribute, that is the name of
the attribute, stripped from any namespace in front of it. For example, if
the qualified name is xml:lang
, the returned local name is lang
, if
the element supports that namespace.
The local name is always in lower case, whatever case at the attribute creation.
Note: HTML only supports a fixed set of namespaces on SVG and MathML elements. These are
xml
(for thexml:lang
attribute),xlink
(for thexlink:href
,xlink:show
,xlink:target
andxlink:title
attributes) andxpath
.That means that the local name of an attribute of an HTML element is always be equal to its qualified name: Colons are treated as regular characters. In XML, like in SVG or MathML, the colon denotes the end of the prefix and what is before is the namespace; the local name may be different from the qualified name.
Implementation
external String get localName;