Skip to content

home 2.0.0

katsu-oh edited this page Nov 22, 2022 · 1 revision

<Programmer's Reference>


import

details...
<script type="module">
  import {HTML, E} from "https://cdn.jsdelivr.net/gh/katsu-oh/[email protected]/html.min.js";
  HTML(document.body). $P. T`Welcome to html.js!`. $. publish();
</script>

The import must be called before HTML() or E() is called.



HTML([target])

details...
new HTML(targetElement)
new HTML`target-element-id`
new HTML()
HTML(targetElement)
HTML`target-element-id`
HTML()

An instance of HTML object with a template element as the root element is created. The template element is set as the current element of the instance of HTML object at first.

Parameters

target
The target element or the ID of the target element to publish. If omitted, HTML.prototype.publish() must not be called.

Return value

A created instance of HTML object.


HTML.prototype.$<TAG_NAME>

details...

Function list:
$A, $ABBR, $ACRONYM, $ADDRESS, $APPLET, $AREA, $ARTICLE, $ASIDE, $AUDIO, $B, $BASE, $BASEFONT, $BDI, $BDO, $BIG, $BLOCKQUOTE, $BODY, $BR, $BUTTON, $CANVAS, $CAPTION, $CENTER, $CITE, $CODE, $COL, $COLGROUP, $COMMAND, $DATA, $DATALIST, $DD, $DEL, $DETAILS, $DFN, $DIR, $DIV, $DL, $DT, $EM, $EMBED, $FIELDSET, $FIGCAPTION, $FIGURE, $FONT, $FOOTER, $FORM, $FRAME, $FRAMESET, $H1, $H2, $H3, $H4, $H5, $H6, $HEAD, $HEADER, $HGROUP, $HR, $HTML, $I, $IFRAME, $IMG, $INPUT, $INS, $ISINDEX, $KBD, $KEYGEN, $LABEL, $LEGEND, $LI, $LINK, $MAIN, $MAP, $MARK, $MENU, $MENUITEM, $META, $METER, $NAV, $NOFRAMES, $NOSCRIPT, $OBJECT, $OL, $OPTGROUP, $OPTION, $OUTPUT, $P, $PARAM, $PICTURE, $PRE, $PROGRESS, $Q, $RP, $RT, $RUBY, $S, $SAMP, $SCRIPT, $SECTION, $SELECT, $SLOT, $SMALL, $SOURCE, $SPAN, $STRIKE, $STRONG, $STYLE, $SUB, $SUMMARY, $SUP, $TABLE, $TBODY, $TD, $TEMPLATE, $TEXTAREA, $TFOOT, $TH, $THEAD, $TIME, $TITLE, $TR, $TRACK, $TT, $U, $UL, $VAR, $VIDEO, $WBR

HTML`target-element-id`.$DIV.$;

An element with the <TAG_NAME> is created and added to the end of the children of the current element of this HTML. The created element is set as the current element of this HTML.

Parameters

<TAG_NAME>
The name that the element is created with. See Function list.

Return value

This HTML.

Exceptions

ReferenceError: $<TAG_NAME> is not defined.

HTML.prototype.$

details...
HTML`target-element-id`.$SPAN.$;
HTML(spanElement1).$BR.$;

The parent of the current element of this HTML is set as the current element of this HTML. It is also necessary for tags that have no end tags.

Return value

This HTML.

Exceptions

SyntaxError: $ is unexpected.

HTML.prototype.<attributeName>[(value)]

details...

Function list:
abbr, accept, acceptCharset, accesskey, action, align, alink, allow, allowfullscreen, alt, archive, ariaActivedescendant, ariaAtomic, ariaAutocomplete, ariaBusy, ariaChecked, ariaColcount, ariaColindex, ariaColspan, ariaControls, ariaCurrent, ariaDescribedby, ariaDetails, ariaDisabled, ariaDropeffect, ariaErrormessage, ariaExpanded, ariaFlowto, ariaGrabbed, ariaHaspopup, ariaHidden, ariaInvalid, ariaKeyshortcuts, ariaLabel, ariaLabelledby, ariaLevel, ariaLive, ariaModal, ariaMultiline, ariaMultiselectable, ariaOrientation, ariaOwns, ariaPlaceholder, ariaPosinset, ariaPressed, ariaReadonly, ariaRelevant, ariaRequired, ariaRoledescription, ariaRowcount, ariaRowindex, ariaRowspan, ariaSelected, ariaSetsize, ariaSort, ariaValuemax, ariaValuemin, ariaValuenow, ariaValuetext, as, async, autocapitalize, autocomplete, autofocus, autoplay, axis, background, bgcolor, border, capture, cellpadding, cellspacing, char, charoff, charset, checked, cite, class, classid, clear, code, codebase, codetype, color, cols, colspan, compact, content, contenteditable, controls, coords, crossorigin, data, datetime, declare, decoding, default, defer, dir, dirname, disabled, download, draggable, enctype, enterkeyhint, face, for, form, formaction, formenctype, formmethod, formnovalidate, formtarget, frame, frameborder, headers, height, hidden, high, href, hreflang, hspace, httpEquiv, id, imagesizes, imagesrcset, inputmode, integrity, is, ismap, itemid, itemprop, itemref, itemscope, itemtype, kind, label, lang, language, link, list, loading, longdesc, loop, low, marginheight, marginwidth, max, maxlength, media, method, min, minlength, multiple, muted, name, nohref, nomodule, nonce, noresize, noshade, novalidate, nowrap, object, open, optimum, pattern, ping, placeholder, playsinline, poster, preload, profile, prompt, readonly, referrerpolicy, rel, required, rev, reversed, role, rows, rowspan, rules, sandbox, scheme, scope, scrolling, selected, shape, size, sizes, slot, span, spellcheck, src, srcdoc, srclang, srcset, standby, start, step, style, summary, tabindex, target, text, title, translate, type, usemap, valign, value, valuetype, version, vlink, vspace, width, wrap
*1. Attributes with hyphen separated names are implemented in functions with the names converted to lower camel case.
*2. Custom data attributes ('data-*') are available by HTML.prototype.data_().

HTML(divElement).$A.href(url).autofocus(true).$;
HTML(divElement).$A.href`http://www.example.com/`.autofocus.$;

The value is assigned to the attribute with the <attributeName> of the current element of this HTML. If the value is omitted or true, "" is assigned. If the value is false, no value is assigned. If the value is not a boolean, a string that the value is converted to is assigned.

Parameters

<attributeName>
The name of the attribute that the value is assigned to. See Function list.
value
The value assigned to the attribute with the <attributeName> of the current element of this HTML. If omitted or true, "". If false, no value. If not a boolean, converted to a string.

Return value

This HTML.

Exceptions

ReferenceError: <attributeName> is not defined.

HTML.prototype.data_(name, value)

details...
HTML(document.body).$DIV.data_(name, value).$;
HTML(document.body).$DIV.data_(name)(value).$;
HTML(document.body).$DIV.data_(name)`value1`.$;
HTML(document.body).$DIV.data_`name1`(value).$;
HTML(document.body).$DIV.data_`name1``value1`.$;

The value is assigned to the custom data attribute with the name of the current element of this HTML.

Parameters

name
The name of the custom data attribute that the value is assigned to. The name cannot contain uppercase letters. If consisting of multiple words, the name can be separated by hyphens.
value
The value assigned to the custom data attribute with the name of the current element of this HTML.

Return value

This HTML.

HTML.prototype.s.<styleName>(value)

details...

Function list:
s.accentColor, s.alignContent, s.alignItems, s.alignSelf, s.alignTracks, s.all, s.animation, s.animationDelay, s.animationDirection, s.animationDuration, s.animationFillMode, s.animationIterationCount, s.animationName, s.animationPlayState, s.animationTimeline, s.animationTimingFunction, s.appearance, s.aspectRatio, s.azimuth, s.backdropFilter, s.backfaceVisibility, s.background, s.backgroundAttachment, s.backgroundBlendMode, s.backgroundClip, s.backgroundColor, s.backgroundImage, s.backgroundOrigin, s.backgroundPosition, s.backgroundPositionX, s.backgroundPositionY, s.backgroundRepeat, s.backgroundSize, s.blockSize, s.border, s.borderBlock, s.borderBlockColor, s.borderBlockEnd, s.borderBlockEndColor, s.borderBlockEndStyle, s.borderBlockEndWidth, s.borderBlockStart, s.borderBlockStartColor, s.borderBlockStartStyle, s.borderBlockStartWidth, s.borderBlockStyle, s.borderBlockWidth, s.borderBottom, s.borderBottomColor, s.borderBottomLeftRadius, s.borderBottomRightRadius, s.borderBottomStyle, s.borderBottomWidth, s.borderCollapse, s.borderColor, s.borderEndEndRadius, s.borderEndStartRadius, s.borderImage, s.borderImageOutset, s.borderImageRepeat, s.borderImageSlice, s.borderImageSource, s.borderImageWidth, s.borderInline, s.borderInlineColor, s.borderInlineEnd, s.borderInlineEndColor, s.borderInlineEndStyle, s.borderInlineEndWidth, s.borderInlineStart, s.borderInlineStartColor, s.borderInlineStartStyle, s.borderInlineStartWidth, s.borderInlineStyle, s.borderInlineWidth, s.borderLeft, s.borderLeftColor, s.borderLeftStyle, s.borderLeftWidth, s.borderRadius, s.borderRight, s.borderRightColor, s.borderRightStyle, s.borderRightWidth, s.borderSpacing, s.borderStartEndRadius, s.borderStartStartRadius, s.borderStyle, s.borderTop, s.borderTopColor, s.borderTopLeftRadius, s.borderTopRightRadius, s.borderTopStyle, s.borderTopWidth, s.borderWidth, s.bottom, s.boxDecorationBreak, s.boxShadow, s.boxSizing, s.breakAfter, s.breakBefore, s.breakInside, s.captionSide, s.caretColor, s.clear, s.clip, s.clipPath, s.color, s.colorScheme, s.columnCount, s.columnFill, s.columnGap, s.columnRule, s.columnRuleColor, s.columnRuleStyle, s.columnRuleWidth, s.columns, s.columnSpan, s.columnWidth, s.contain, s.content, s.contentVisibility, s.counterIncrement, s.counterReset, s.counterSet, s.crop, s.cue, s.cueAfter, s.cueBefore, s.cursor, s.direction, s.display, s.elevation, s.emptyCells, s.filter, s.fit, s.fitPosition, s.flex, s.flexBasis, s.flexDirection, s.flexFlow, s.flexGrow, s.flexShrink, s.flexWrap, s.float, s.font, s.fontFamily, s.fontFeatureSettings, s.fontKerning, s.fontLanguageOverride, s.fontOpticalSizing, s.fontSize, s.fontSizeAdjust, s.fontStretch, s.fontStyle, s.fontSynthesis, s.fontVariant, s.fontVariantAlternates, s.fontVariantCaps, s.fontVariantEastAsian, s.fontVariantLigatures, s.fontVariantNumeric, s.fontVariantPosition, s.fontVariationSettings, s.fontWeight, s.forcedColorAdjust, s.gap, s.grid, s.gridArea, s.gridAutoColumns, s.gridAutoFlow, s.gridAutoRows, s.gridCell, s.gridColumn, s.gridColumnAlign, s.gridColumnEnd, s.gridColumns, s.gridColumnSizing, s.gridColumnSpan, s.gridColumnStart, s.gridFlow, s.gridRow, s.gridRowAlign, s.gridRowEnd, s.gridRows, s.gridRowSizing, s.gridRowSpan, s.gridRowStart, s.gridTemplate, s.gridTemplateAreas, s.gridTemplateColumns, s.gridTemplateRows, s.hangingPunctuation, s.height, s.hyphenateCharacter, s.hyphens, s.icon, s.imageOrientation, s.imageRendering, s.imageResolution, s.imeMode, s.initialLetter, s.initialLetterAlign, s.inlineSize, s.inset, s.insetBlock, s.insetBlockEnd, s.insetBlockStart, s.insetInline, s.insetInlineEnd, s.insetInlineStart, s.isolation, s.justifyContent, s.justifyItems, s.justifySelf, s.justifyTracks, s.left, s.letterSpacing, s.lineBreak, s.lineHeight, s.lineHeightStep, s.listStyle, s.listStyleImage, s.listStylePosition, s.listStyleType, s.margin, s.marginBlock, s.marginBlockEnd, s.marginBlockStart, s.marginBottom, s.marginInline, s.marginInlineEnd, s.marginInlineStart, s.marginLeft, s.marginRight, s.marginTop, s.marginTrim, s.marks, s.marqueeDirection, s.marqueePlayCount, s.marqueeSpeed, s.marqueeStyle, s.mask, s.maskBorder, s.maskBorderMode, s.maskBorderOutset, s.maskBorderRepeat, s.maskBorderSlice, s.maskBorderSource, s.maskBorderWidth, s.maskClip, s.maskComposite, s.maskImage, s.maskMode, s.maskOrigin, s.maskPosition, s.maskRepeat, s.maskSize, s.maskType, s.masonryAutoFlow, s.maxBlockSize, s.maxHeight, s.maxInlineSize, s.maxWidth, s.minBlockSize, s.minHeight, s.minInlineSize, s.minWidth, s.mixBlendMode, s.moveTo, s.navDown, s.navIndex, s.navLeft, s.navRight, s.navUp, s.objectFit, s.objectPosition, s.offset, s.offsetAnchor, s.offsetDistance, s.offsetPath, s.offsetPosition, s.offsetRotate, s.opacity, s.order, s.orphans, s.outline, s.outlineColor, s.outlineOffset, s.outlineStyle, s.outlineWidth, s.overflow, s.overflowAnchor, s.overflowBlock, s.overflowClipMargin, s.overflowInline, s.overflowStyle, s.overflowWrap, s.overflowX, s.overflowY, s.overscrollBehavior, s.overscrollBehaviorBlock, s.overscrollBehaviorInline, s.overscrollBehaviorX, s.overscrollBehaviorY, s.padding, s.paddingBlock, s.paddingBlockEnd, s.paddingBlockStart, s.paddingBottom, s.paddingInline, s.paddingInlineEnd, s.paddingInlineStart, s.paddingLeft, s.paddingRight, s.paddingTop, s.page, s.pageBreakAfter, s.pageBreakBefore, s.pageBreakInside, s.pagePolicy, s.paintOrder, s.pause, s.pauseAfter, s.pauseBefore, s.perspective, s.perspectiveOrigin, s.pitch, s.pitchRange, s.placeContent, s.placeItems, s.placeSelf, s.playDuring, s.pointerEvents, s.position, s.printColorAdjust, s.quotes, s.resize, s.rest, s.restAfter, s.restBefore, s.revert, s.richness, s.right, s.rotate, s.rowGap, s.rubyAlign, s.rubyPosition, s.scale, s.scrollbarColor, s.scrollbarGutter, s.scrollbarWidth, s.scrollBehavior, s.scrollMargin, s.scrollMarginBlock, s.scrollMarginBlockEnd, s.scrollMarginBlockStart, s.scrollMarginBottom, s.scrollMarginInline, s.scrollMarginInlineEnd, s.scrollMarginInlineStart, s.scrollMarginLeft, s.scrollMarginRight, s.scrollMarginTop, s.scrollPadding, s.scrollPaddingBlock, s.scrollPaddingBlockEnd, s.scrollPaddingBlockStart, s.scrollPaddingBottom, s.scrollPaddingInline, s.scrollPaddingInlineEnd, s.scrollPaddingInlineStart, s.scrollPaddingLeft, s.scrollPaddingRight, s.scrollPaddingTop, s.scrollSnapAlign, s.scrollSnapStop, s.scrollSnapType, s.shapeImageThreshold, s.shapeMargin, s.shapeOutside, s.size, s.speak, s.speakAs, s.speakHeader, s.speakNumeral, s.speakPunctuation, s.speechRate, s.stress, s.tableLayout, s.tabSize, s.textAlign, s.textAlignLast, s.textCombineHorizontal, s.textCombineMode, s.textCombineUpright, s.textDecoration, s.textDecorationColor, s.textDecorationLine, s.textDecorationSkip, s.textDecorationSkipInk, s.textDecorationStyle, s.textDecorationThickness, s.textEmphasis, s.textEmphasisColor, s.textEmphasisPosition, s.textEmphasisStyle, s.textIndent, s.textJustify, s.textOrientation, s.textOverflow, s.textRendering, s.textShadow, s.textSizeAdjust, s.textTransform, s.textUnderlineOffset, s.textUnderlinePosition, s.top, s.touchAction, s.transform, s.transformBox, s.transformOrigin, s.transformStyle, s.transition, s.transitionDelay, s.transitionDuration, s.transitionProperty, s.transitionTimingFunction, s.translate, s.unicodeBidi, s.userSelect, s.verticalAlign, s.visibility, s.voiceBalance, s.voiceDuration, s.voiceFamily, s.voicePitch, s.voiceRange, s.voiceRate, s.voiceStress, s.voiceVolume, s.volume, s.whiteSpace, s.widows, s.width, s.willChange, s.wordBreak, s.wordSpacing, s.wordWrap, s.writingMode, s.zIndex
*1. Styles with hyphen separated names are implemented in functions with the names converted to lower camel case.

HTML'div-1'.$SPAN.s.color('red').$;
HTML'div-1'.$SPAN.s.color`red`.$;

The value is assigned to the style with the <styleName> of the current element of this HTML.

Parameters

<styleName>
The name of the style that the value is assigned to. See Function list.
value
The value assigned to the style with the <styleName> of the current element of this HTML.

Return value

This HTML.

Exceptions

ReferenceError: <styleName> is not defined.

HTML.prototype.on.<eventType>(listener[, options])

details...

Function list:
on.abort, on.afterprint, on.afterscriptexecute, on.animationcancel, on.animationend, on.animationiteration, on.animationstart, on.appinstalled, on.auxclick, on.beforeinput, on.beforeprint, on.beforescriptexecute, on.beforeunload, on.blur, on.cancel, on.canplay, on.canplaythrough, on.change, on.click, on.close, on.compositionend, on.compositionstart, on.compositionupdate, on.contextmenu, on.copy, on.cuechange, on.cut, on.dblclick, on.devicemotion, on.deviceorientation, on.DOMActivate, on.DOMContentLoaded, on.DOMMouseScroll, on.drag, on.dragend, on.dragenter, on.dragleave, on.dragover, on.dragstart, on.drop, on.durationchange, on.emptied, on.ended, on.enterpictureinpicture, on.error, on.focus, on.focusin, on.focusout, on.formdata, on.fullscreenchange, on.fullscreenerror, on.gamepadconnected, on.gamepaddisconnected, on.gotpointercapture, on.hashchange, on.input, on.invalid, on.keydown, on.keypress, on.keyup, on.languagechange, on.leavepictureinpicture, on.load, on.loadeddata, on.loadedmetadata, on.loadstart, on.lostpointercapture, on.message, on.messageerror, on.mousedown, on.mouseenter, on.mouseleave, on.mousemove, on.mouseout, on.mouseover, on.mouseup, on.mousewheel, on.offline, on.online, on.orientationchange, on.overflow, on.pagehide, on.pageshow, on.paste, on.pause, on.play, on.playing, on.pointercancel, on.pointerdown, on.pointerenter, on.pointerleave, on.pointerlockchange, on.pointerlockerror, on.pointermove, on.pointerout, on.pointerover, on.pointerup, on.popstate, on.progress, on.ratechange, on.readystatechange, on.rejectionhandled, on.reset, on.resize, on.scroll, on.search, on.seeked, on.seeking, on.select, on.selectionchange, on.selectstart, on.show, on.slotchange, on.stalled, on.storage, on.submit, on.suspend, on.timeupdate, on.toggle, on.touchcancel, on.touchend, on.touchmove, on.touchstart, on.transitioncancel, on.transitionend, on.transitionrun, on.transitionstart, on.underflow, on.unhandledrejection, on.unload, on.visibilitychange, on.volumechange, on.waiting, on.webglcontextcreationerror, on.webglcontextlost, on.webglcontextrestored, on.wheel

HTML'sectionA'.$DIV.on.click(handler).$;
HTML'sectionA'.$DIV.on.click(handler, false).$;

The listener is added to the event listeners for the <eventType> on the current element of this HTML.

Parameters

<eventType>
The event type that the listener is added to the event listeners for. See Function list.
listener
The function or the EventListener object that is added to the event listeners for the <eventType> on the current element of this HTML.
options
Same as options or useCapture of EventTarget.addEventListener().

Return value

This HTML.

Exceptions

ReferenceError: <eventType> is not defined.

HTML.prototype.on.publish(listener[, options])

details...
HTML'sectionA'.$DIV.on.publish(handler).$;
HTML'sectionA'.$DIV.on.publish(handler, false).$;

The listener is added to the event listeners for the event type 'publish' on the current element of this HTML. Event listeners for the event type 'publish' are triggered by calling HTML.prototype.publish().

Parameters

listener
The function or the EventListener object that is added to the event listeners for the event type 'publish' on the current element of this HTML.
options
Same as options or useCapture of EventTarget.addEventListener().

Return value

This HTML.

HTML.prototype.T(text)

details...
HTML(container).$SPAN.s.color`red`.T(message).$;
HTML(container).$SPAN.s.color`red`.T`This is a red message.`.$;

The text is added to the end of the contents of the current element of this HTML. The text can contain HTML special characters, they appear as escapes in HTML codes.

Parameters

text
The text content that is added to the end of the content of the current element of this HTML.

Return value

This HTML.

HTML.prototype.HTML(html)

details...
HTML(container).$DIV.HTML`&nbsp;`.$;
HTML(container).$DIV.HTML(HTML().$SPAN.T`text`.$).$;

The html is added to the end of the contents of the current element of this HTML. The html is the other instance of HTML object or a string that contains the HTML code. If the html is an instance of HTML object, the contents of the root element of the html are moved, and the html will no longer be available.

Parameters

html
The other instance of HTML object or a string that contains the HTML code that is added to the end of the contents of the current element of this HTML.

Return value

This HTML.

Exceptions

SyntaxError: $ is missing.


HTML.prototype.publish([removeTarget])

details...
HTML'target-id'.$SPAN.T`text`.$.publish();
HTML'target-id'.$SPAN.T`text`.$.publish(true);

The target element that is specified in HTML() or the contents of the target element are replaced with the contents of the root element of this HTML. The event listeners for the event type 'public' on the elements that the root element of this HTML contains are called after being replaced. The contents of the root element of this HTML are moved, and this HTML will no longer be available.

Parameters

removeTarget
If true, the contents of the root element are added where the target element is, the target element is removed, else the contents of the root element are added as the contents of the target element, the previous contents of the target element are removed.

Exceptions

SyntaxError: $ is missing.

HTML.prototype.toString()

details...
const html = HTML().$SPAN.T`text`.$.toString();
alert(HTML().$SPAN.T`text`.$);

The HTML code of the contents of the current element of this HTML is retrieved as a string.

Return value

A string that contains the HTML code of the contents of the current element of this HTML.

HTML.prototype.toLocaleString()

details...
const js = HTML().HTML
 `<div>
    <p class="p1" style="background-color: white;">
      Converting from HTML to JavaScript...
    </p>
  </div>`
.toLocaleString();

The JavaScript code that manipulates an instance of HTML object to have the same contents as the current element of this HTML is retrieved as a string.

Return value

A string that contains the JavaScript code that manipulates an instance of HTML object to have the same contents as the current element of this HTML.

*1. Line breaks and whitespace characters following line breaks in text contents are ignored.
*2. Names of functions are computed, therefore functions may not be defined.


HTML.prototype.defineTag(name)

details...
HTML.prototype.defineTag("NEW-TAG");
delete HTML.prototype.$NEW_TAG;
const h = HTML();
h.defineTag("NEW-TAG");
delete h.$NEW_TAG;

A function is defined for the tag with the name in future HTML or custom elements. The function is named in snake case if the name contains a hyphen.

Parameters

name
The name of the tag that the function is defined for.

HTML.prototype.defineAttribute(name)

details...
HTML.prototype.defineAttribute("new-attribute");
delete HTML.prototype.newAttribute;
const h = HTML();
h.defineAttribute("new-attribute");
delete h.newAttribute;

A function is defined for the attribute with the name in future HTML. The function is named in camel case if the name contains a hyphen.

Parameters

name
The name of the attribute that the function is defined for.

HTML.prototype.defineStyle(name)

details...
HTML.prototype.defineStyle("new-style");
delete HTML.prototype.s.newStyle;
const h = HTML();
h.defineStyle("new-style");
delete h.s.newStyle;

A function is defined for the style with the name in future HTML. The function is named in camel case if the name contains a hyphen.

Parameters

name
The name of the style that the function is defined for.

HTML.prototype.defineEvent(type)

details...
HTML.prototype.defineEvent("new-event");
delete HTML.prototype.on.newEvent;
const h = HTML();
h.defineEvent("new-event");
delete h.on.newEvent;

A function is defined for the event with the type in future HTML. The function is named in camel case if the name contains a hyphen.

Parameters

type
The type of the event that the function is defined for.



E(id)

details...
E`div-target`.style.visibility = "hidden";

The element that the id is assigned to is searched for in the document.

Parameters

id
The ID that the element that is searched for has.

Return value

The element that has the id, or null if no element has the id.