Create a single DOM element and optionally attaches it to parent
.
Same as el.innerHtml = body
, use with caution! If body
is an {@link @thi.ng/api#IDeref} it'll be automatically deref'd.
Takes an object (or string) of CSS properties, compiles them into a single CSS string and sets it as style
attribute on the given element.
Same as el.innerText = body
, however if body
is an {@link @thi.ng/api#IDeref} it'll be automatically deref'd.
hdom-style DOM tree creation from hiccup format. Returns DOM element of tree
root. See $el for further details.
Registers an XML namespace prefix and its URL for later use, e.g. to define namespaced elements/attributes.
Generated using TypeDoc
Takes an object of attributes and applies them to given DOM element.
The following rules & transformations are applied (in the stated order):
deref
don
are considered event listeners and can either have a function value or tuple of[listener, opts]
, whereopts
are the standard.addEventListener()
optionsattribs
object and return value usedCSS classs are to given as
class
attribute, with its value either a string or an object of booleans. If the latter, the given class names are either added to or removed from the current list of classes.CSS style rules can be defined via the
style
attrib. Please $style for further details.Data attributes are to be given as object under the
data
attribute name, with its values being merged with the element's currentdataset
property.Depending on element type the
value
attribute will be updated keeping the current cursor position / selection intact.