Creates a custom element.
For more details, see About Custom Elements below.
Parameters:
elementTypeName
That may be either '#CUSTOM'
element type or any other element types extending it.
null
, the '#CUSTOM'
element type is assumed.
value
The element value can be accessed later via
GOMElement.value
property.
If this parameter is not specified, by default, the custom element
has null
value.
attr
The passed GOMAttribute
object is used only as
a provider of the name and value of the new attribute
(via attr.name
and attr.value
properties).
That object can be obtained from another element using getAttr()
function or created with Attr()
function.
attributes
The passed array should be created with a function-call-like construct looking as
GOMAttribute[] (
...
)
GOMAttribute
objects separated with commas.
The GOMAttribute
objects provide names and values of new attributes
(via GOMAttribute.name
and GOMAttribute.value
properties).
They can be obtained from other elements using getAttr()
function or
created with Attr()
function.
Note:
If neither attr
nor attributes
parameter is specified (or it is null
),
the custom element will be created without attributes.
The attributes can be added later using setAttr()
function.
children
Any other objects (e.g. non-custom elements) will be ignored.
When this parameter is omitted or null
, the new custom element will have no children.
GOMElement
object representing the created custom element.