package app // Code generated by go generate; DO NOT EDIT. import ( "fmt" "strings" ) // HTMLA is the interface that describes a "a" HTML element. type HTMLA interface { UI // Body set the content of the element. Body(elems ...UI) HTMLA // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLA // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLA // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLA // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLA // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLA // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLA // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLA // Dir specifies the text direction for the content in an element. Dir(v string) HTMLA // Download specifies that the target will be downloaded when a user clicks on the hyperlink. Download(v string) HTMLA // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLA // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLA // Href specifies the URL of the page the link goes to. Href(v string) HTMLA // HrefLang specifies the language of the linked document. HrefLang(v string) HTMLA // ID specifies a unique id for an element. ID(v string) HTMLA // Lang specifies the language of the element's content. Lang(v string) HTMLA // Media specifies what media/device the linked document is optimized for. Media(v string) HTMLA // Ping specifies a list of URLs to be notified if the user follows the hyperlink. Ping(v string) HTMLA // Rel specifies the relationship between the current document and the linked document. Rel(v string) HTMLA // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLA // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLA // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLA // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLA // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLA // Target specifies the target for where to open the linked document or where to submit the form. Target(v string) HTMLA // Title specifies extra information about an element. Title(v string) HTMLA // Type specifies the type of element. Type(v string) HTMLA // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLA // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLA // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLA // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLA // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLA // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLA // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLA // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLA // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLA // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLA // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLA // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLA // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLA // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLA // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLA // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLA // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLA // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLA // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLA // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLA // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLA // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLA // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLA // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLA // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLA // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLA // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLA // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLA // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLA // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLA // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLA // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLA // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLA } // A returns an HTML element that defines a hyperlink. func A() HTMLA { e := &htmlA{ htmlElement: htmlElement{ tag: "a", isSelfClosing: false, }, } return e } type htmlA struct { htmlElement } func (e *htmlA) Body(v ...UI) HTMLA { e.setChildren(v...) return e } func (e *htmlA) Text(v any) HTMLA { return e.Body(Text(v)) } func (e *htmlA) AccessKey(v string) HTMLA { e.setAttr("accesskey", v) return e } func (e *htmlA) Aria(k string, v any) HTMLA { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlA) Attr(n string, v any) HTMLA { e.setAttr(n, v) return e } func (e *htmlA) Class(v ...string) HTMLA { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlA) ContentEditable(v bool) HTMLA { e.setAttr("contenteditable", v) return e } func (e *htmlA) DataSet(k string, v any) HTMLA { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlA) Dir(v string) HTMLA { e.setAttr("dir", v) return e } func (e *htmlA) Download(v string) HTMLA { e.setAttr("download", v) return e } func (e *htmlA) Draggable(v bool) HTMLA { e.setAttr("draggable", v) return e } func (e *htmlA) Hidden(v bool) HTMLA { e.setAttr("hidden", v) return e } func (e *htmlA) Href(v string) HTMLA { e.setAttr("href", v) return e } func (e *htmlA) HrefLang(v string) HTMLA { e.setAttr("hreflang", v) return e } func (e *htmlA) ID(v string) HTMLA { e.setAttr("id", v) return e } func (e *htmlA) Lang(v string) HTMLA { e.setAttr("lang", v) return e } func (e *htmlA) Media(v string) HTMLA { e.setAttr("media", v) return e } func (e *htmlA) Ping(v string) HTMLA { e.setAttr("ping", v) return e } func (e *htmlA) Rel(v string) HTMLA { e.setAttr("rel", v) return e } func (e *htmlA) Role(v string) HTMLA { e.setAttr("role", v) return e } func (e *htmlA) Spellcheck(v bool) HTMLA { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlA) Style(k, v string) HTMLA { e.setAttr("style", k+":"+v) return e } func (e *htmlA) Styles(s map[string]string) HTMLA { for k, v := range s { e.Style(k, v) } return e } func (e *htmlA) TabIndex(v int) HTMLA { e.setAttr("tabindex", v) return e } func (e *htmlA) Target(v string) HTMLA { e.setAttr("target", v) return e } func (e *htmlA) Title(v string) HTMLA { e.setAttr("title", v) return e } func (e *htmlA) Type(v string) HTMLA { e.setAttr("type", v) return e } func (e *htmlA) On(event string, h EventHandler, scope ...any) HTMLA { e.setEventHandler(event, h, scope...) return e } func (e *htmlA) OnBlur(h EventHandler, scope ...any) HTMLA { e.setEventHandler("blur", h, scope...) return e } func (e *htmlA) OnChange(h EventHandler, scope ...any) HTMLA { e.setEventHandler("change", h, scope...) return e } func (e *htmlA) OnClick(h EventHandler, scope ...any) HTMLA { e.setEventHandler("click", h, scope...) return e } func (e *htmlA) OnContextMenu(h EventHandler, scope ...any) HTMLA { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlA) OnCopy(h EventHandler, scope ...any) HTMLA { e.setEventHandler("copy", h, scope...) return e } func (e *htmlA) OnCut(h EventHandler, scope ...any) HTMLA { e.setEventHandler("cut", h, scope...) return e } func (e *htmlA) OnDblClick(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlA) OnDrag(h EventHandler, scope ...any) HTMLA { e.setEventHandler("drag", h, scope...) return e } func (e *htmlA) OnDragEnd(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlA) OnDragEnter(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlA) OnDragLeave(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlA) OnDragOver(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlA) OnDragStart(h EventHandler, scope ...any) HTMLA { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlA) OnDrop(h EventHandler, scope ...any) HTMLA { e.setEventHandler("drop", h, scope...) return e } func (e *htmlA) OnFocus(h EventHandler, scope ...any) HTMLA { e.setEventHandler("focus", h, scope...) return e } func (e *htmlA) OnInput(h EventHandler, scope ...any) HTMLA { e.setEventHandler("input", h, scope...) return e } func (e *htmlA) OnInvalid(h EventHandler, scope ...any) HTMLA { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlA) OnKeyDown(h EventHandler, scope ...any) HTMLA { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlA) OnKeyPress(h EventHandler, scope ...any) HTMLA { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlA) OnKeyUp(h EventHandler, scope ...any) HTMLA { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlA) OnMouseDown(h EventHandler, scope ...any) HTMLA { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlA) OnMouseMove(h EventHandler, scope ...any) HTMLA { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlA) OnMouseOut(h EventHandler, scope ...any) HTMLA { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlA) OnMouseOver(h EventHandler, scope ...any) HTMLA { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlA) OnMouseUp(h EventHandler, scope ...any) HTMLA { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlA) OnPaste(h EventHandler, scope ...any) HTMLA { e.setEventHandler("paste", h, scope...) return e } func (e *htmlA) OnReset(h EventHandler, scope ...any) HTMLA { e.setEventHandler("reset", h, scope...) return e } func (e *htmlA) OnScroll(h EventHandler, scope ...any) HTMLA { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlA) OnSearch(h EventHandler, scope ...any) HTMLA { e.setEventHandler("search", h, scope...) return e } func (e *htmlA) OnSelect(h EventHandler, scope ...any) HTMLA { e.setEventHandler("select", h, scope...) return e } func (e *htmlA) OnSubmit(h EventHandler, scope ...any) HTMLA { e.setEventHandler("submit", h, scope...) return e } func (e *htmlA) OnWheel(h EventHandler, scope ...any) HTMLA { e.setEventHandler("wheel", h, scope...) return e } // HTMLAbbr is the interface that describes a "abbr" HTML element. type HTMLAbbr interface { UI // Body set the content of the element. Body(elems ...UI) HTMLAbbr // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLAbbr // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLAbbr // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLAbbr // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLAbbr // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLAbbr // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLAbbr // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLAbbr // Dir specifies the text direction for the content in an element. Dir(v string) HTMLAbbr // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLAbbr // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLAbbr // ID specifies a unique id for an element. ID(v string) HTMLAbbr // Lang specifies the language of the element's content. Lang(v string) HTMLAbbr // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLAbbr // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLAbbr // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLAbbr // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLAbbr // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLAbbr // Title specifies extra information about an element. Title(v string) HTMLAbbr // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLAbbr // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLAbbr // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLAbbr // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLAbbr // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLAbbr // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLAbbr // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLAbbr // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLAbbr // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLAbbr // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLAbbr // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLAbbr // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLAbbr // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLAbbr // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLAbbr // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLAbbr // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLAbbr // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLAbbr // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLAbbr // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLAbbr // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLAbbr // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLAbbr // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLAbbr // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLAbbr // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLAbbr // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLAbbr // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLAbbr // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLAbbr // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLAbbr // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLAbbr // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLAbbr // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLAbbr // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLAbbr // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLAbbr } // Abbr returns an HTML element that defines an abbreviation or an acronym. func Abbr() HTMLAbbr { e := &htmlAbbr{ htmlElement: htmlElement{ tag: "abbr", isSelfClosing: false, }, } return e } type htmlAbbr struct { htmlElement } func (e *htmlAbbr) Body(v ...UI) HTMLAbbr { e.setChildren(v...) return e } func (e *htmlAbbr) Text(v any) HTMLAbbr { return e.Body(Text(v)) } func (e *htmlAbbr) AccessKey(v string) HTMLAbbr { e.setAttr("accesskey", v) return e } func (e *htmlAbbr) Aria(k string, v any) HTMLAbbr { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAbbr) Attr(n string, v any) HTMLAbbr { e.setAttr(n, v) return e } func (e *htmlAbbr) Class(v ...string) HTMLAbbr { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlAbbr) ContentEditable(v bool) HTMLAbbr { e.setAttr("contenteditable", v) return e } func (e *htmlAbbr) DataSet(k string, v any) HTMLAbbr { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAbbr) Dir(v string) HTMLAbbr { e.setAttr("dir", v) return e } func (e *htmlAbbr) Draggable(v bool) HTMLAbbr { e.setAttr("draggable", v) return e } func (e *htmlAbbr) Hidden(v bool) HTMLAbbr { e.setAttr("hidden", v) return e } func (e *htmlAbbr) ID(v string) HTMLAbbr { e.setAttr("id", v) return e } func (e *htmlAbbr) Lang(v string) HTMLAbbr { e.setAttr("lang", v) return e } func (e *htmlAbbr) Role(v string) HTMLAbbr { e.setAttr("role", v) return e } func (e *htmlAbbr) Spellcheck(v bool) HTMLAbbr { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlAbbr) Style(k, v string) HTMLAbbr { e.setAttr("style", k+":"+v) return e } func (e *htmlAbbr) Styles(s map[string]string) HTMLAbbr { for k, v := range s { e.Style(k, v) } return e } func (e *htmlAbbr) TabIndex(v int) HTMLAbbr { e.setAttr("tabindex", v) return e } func (e *htmlAbbr) Title(v string) HTMLAbbr { e.setAttr("title", v) return e } func (e *htmlAbbr) On(event string, h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler(event, h, scope...) return e } func (e *htmlAbbr) OnBlur(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("blur", h, scope...) return e } func (e *htmlAbbr) OnChange(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("change", h, scope...) return e } func (e *htmlAbbr) OnClick(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("click", h, scope...) return e } func (e *htmlAbbr) OnContextMenu(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlAbbr) OnCopy(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("copy", h, scope...) return e } func (e *htmlAbbr) OnCut(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("cut", h, scope...) return e } func (e *htmlAbbr) OnDblClick(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlAbbr) OnDrag(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("drag", h, scope...) return e } func (e *htmlAbbr) OnDragEnd(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlAbbr) OnDragEnter(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlAbbr) OnDragLeave(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlAbbr) OnDragOver(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlAbbr) OnDragStart(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlAbbr) OnDrop(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("drop", h, scope...) return e } func (e *htmlAbbr) OnFocus(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("focus", h, scope...) return e } func (e *htmlAbbr) OnInput(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("input", h, scope...) return e } func (e *htmlAbbr) OnInvalid(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlAbbr) OnKeyDown(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlAbbr) OnKeyPress(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlAbbr) OnKeyUp(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlAbbr) OnMouseDown(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlAbbr) OnMouseMove(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlAbbr) OnMouseOut(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlAbbr) OnMouseOver(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlAbbr) OnMouseUp(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlAbbr) OnPaste(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("paste", h, scope...) return e } func (e *htmlAbbr) OnReset(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("reset", h, scope...) return e } func (e *htmlAbbr) OnScroll(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlAbbr) OnSearch(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("search", h, scope...) return e } func (e *htmlAbbr) OnSelect(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("select", h, scope...) return e } func (e *htmlAbbr) OnSubmit(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("submit", h, scope...) return e } func (e *htmlAbbr) OnWheel(h EventHandler, scope ...any) HTMLAbbr { e.setEventHandler("wheel", h, scope...) return e } // HTMLAddress is the interface that describes a "address" HTML element. type HTMLAddress interface { UI // Body set the content of the element. Body(elems ...UI) HTMLAddress // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLAddress // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLAddress // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLAddress // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLAddress // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLAddress // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLAddress // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLAddress // Dir specifies the text direction for the content in an element. Dir(v string) HTMLAddress // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLAddress // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLAddress // ID specifies a unique id for an element. ID(v string) HTMLAddress // Lang specifies the language of the element's content. Lang(v string) HTMLAddress // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLAddress // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLAddress // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLAddress // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLAddress // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLAddress // Title specifies extra information about an element. Title(v string) HTMLAddress // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLAddress // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLAddress // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLAddress // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLAddress // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLAddress // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLAddress // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLAddress // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLAddress // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLAddress // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLAddress // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLAddress // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLAddress // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLAddress // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLAddress // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLAddress // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLAddress // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLAddress // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLAddress // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLAddress // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLAddress // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLAddress // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLAddress // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLAddress // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLAddress // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLAddress // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLAddress // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLAddress // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLAddress // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLAddress // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLAddress // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLAddress // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLAddress // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLAddress } // Address returns an HTML element that defines contact information for the author/owner of a document. func Address() HTMLAddress { e := &htmlAddress{ htmlElement: htmlElement{ tag: "address", isSelfClosing: false, }, } return e } type htmlAddress struct { htmlElement } func (e *htmlAddress) Body(v ...UI) HTMLAddress { e.setChildren(v...) return e } func (e *htmlAddress) Text(v any) HTMLAddress { return e.Body(Text(v)) } func (e *htmlAddress) AccessKey(v string) HTMLAddress { e.setAttr("accesskey", v) return e } func (e *htmlAddress) Aria(k string, v any) HTMLAddress { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAddress) Attr(n string, v any) HTMLAddress { e.setAttr(n, v) return e } func (e *htmlAddress) Class(v ...string) HTMLAddress { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlAddress) ContentEditable(v bool) HTMLAddress { e.setAttr("contenteditable", v) return e } func (e *htmlAddress) DataSet(k string, v any) HTMLAddress { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAddress) Dir(v string) HTMLAddress { e.setAttr("dir", v) return e } func (e *htmlAddress) Draggable(v bool) HTMLAddress { e.setAttr("draggable", v) return e } func (e *htmlAddress) Hidden(v bool) HTMLAddress { e.setAttr("hidden", v) return e } func (e *htmlAddress) ID(v string) HTMLAddress { e.setAttr("id", v) return e } func (e *htmlAddress) Lang(v string) HTMLAddress { e.setAttr("lang", v) return e } func (e *htmlAddress) Role(v string) HTMLAddress { e.setAttr("role", v) return e } func (e *htmlAddress) Spellcheck(v bool) HTMLAddress { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlAddress) Style(k, v string) HTMLAddress { e.setAttr("style", k+":"+v) return e } func (e *htmlAddress) Styles(s map[string]string) HTMLAddress { for k, v := range s { e.Style(k, v) } return e } func (e *htmlAddress) TabIndex(v int) HTMLAddress { e.setAttr("tabindex", v) return e } func (e *htmlAddress) Title(v string) HTMLAddress { e.setAttr("title", v) return e } func (e *htmlAddress) On(event string, h EventHandler, scope ...any) HTMLAddress { e.setEventHandler(event, h, scope...) return e } func (e *htmlAddress) OnBlur(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("blur", h, scope...) return e } func (e *htmlAddress) OnChange(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("change", h, scope...) return e } func (e *htmlAddress) OnClick(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("click", h, scope...) return e } func (e *htmlAddress) OnContextMenu(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlAddress) OnCopy(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("copy", h, scope...) return e } func (e *htmlAddress) OnCut(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("cut", h, scope...) return e } func (e *htmlAddress) OnDblClick(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlAddress) OnDrag(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("drag", h, scope...) return e } func (e *htmlAddress) OnDragEnd(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlAddress) OnDragEnter(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlAddress) OnDragLeave(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlAddress) OnDragOver(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlAddress) OnDragStart(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlAddress) OnDrop(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("drop", h, scope...) return e } func (e *htmlAddress) OnFocus(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("focus", h, scope...) return e } func (e *htmlAddress) OnInput(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("input", h, scope...) return e } func (e *htmlAddress) OnInvalid(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlAddress) OnKeyDown(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlAddress) OnKeyPress(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlAddress) OnKeyUp(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlAddress) OnMouseDown(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlAddress) OnMouseMove(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlAddress) OnMouseOut(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlAddress) OnMouseOver(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlAddress) OnMouseUp(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlAddress) OnPaste(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("paste", h, scope...) return e } func (e *htmlAddress) OnReset(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("reset", h, scope...) return e } func (e *htmlAddress) OnScroll(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlAddress) OnSearch(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("search", h, scope...) return e } func (e *htmlAddress) OnSelect(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("select", h, scope...) return e } func (e *htmlAddress) OnSubmit(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("submit", h, scope...) return e } func (e *htmlAddress) OnWheel(h EventHandler, scope ...any) HTMLAddress { e.setEventHandler("wheel", h, scope...) return e } // HTMLArea is the interface that describes a "area" HTML element. type HTMLArea interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLArea // Alt specifies an alternate text when the original element fails to display. Alt(v string) HTMLArea // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLArea // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLArea // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLArea // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLArea // Coords specifies the coordinates of the area. Coords(v string) HTMLArea // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLArea // Dir specifies the text direction for the content in an element. Dir(v string) HTMLArea // Download specifies that the target will be downloaded when a user clicks on the hyperlink. Download(v string) HTMLArea // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLArea // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLArea // Href specifies the URL of the page the link goes to. Href(v string) HTMLArea // HrefLang specifies the language of the linked document. HrefLang(v string) HTMLArea // ID specifies a unique id for an element. ID(v string) HTMLArea // Lang specifies the language of the element's content. Lang(v string) HTMLArea // Media specifies what media/device the linked document is optimized for. Media(v string) HTMLArea // Rel specifies the relationship between the current document and the linked document. Rel(v string) HTMLArea // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLArea // Shape specifies the shape of the area. Shape(v string) HTMLArea // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLArea // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLArea // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLArea // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLArea // Target specifies the target for where to open the linked document or where to submit the form. Target(v string) HTMLArea // Title specifies extra information about an element. Title(v string) HTMLArea // Type specifies the type of element. Type(v string) HTMLArea // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLArea // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLArea // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLArea // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLArea // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLArea // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLArea // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLArea // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLArea // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLArea // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLArea // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLArea // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLArea // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLArea // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLArea // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLArea // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLArea // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLArea // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLArea // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLArea // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLArea // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLArea // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLArea // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLArea // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLArea // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLArea // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLArea // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLArea // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLArea // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLArea // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLArea // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLArea // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLArea // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLArea } // Area returns an HTML element that defines an area inside an image-map. func Area() HTMLArea { e := &htmlArea{ htmlElement: htmlElement{ tag: "area", isSelfClosing: true, }, } return e } type htmlArea struct { htmlElement } func (e *htmlArea) AccessKey(v string) HTMLArea { e.setAttr("accesskey", v) return e } func (e *htmlArea) Alt(v string) HTMLArea { e.setAttr("alt", v) return e } func (e *htmlArea) Aria(k string, v any) HTMLArea { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlArea) Attr(n string, v any) HTMLArea { e.setAttr(n, v) return e } func (e *htmlArea) Class(v ...string) HTMLArea { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlArea) ContentEditable(v bool) HTMLArea { e.setAttr("contenteditable", v) return e } func (e *htmlArea) Coords(v string) HTMLArea { e.setAttr("coords", v) return e } func (e *htmlArea) DataSet(k string, v any) HTMLArea { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlArea) Dir(v string) HTMLArea { e.setAttr("dir", v) return e } func (e *htmlArea) Download(v string) HTMLArea { e.setAttr("download", v) return e } func (e *htmlArea) Draggable(v bool) HTMLArea { e.setAttr("draggable", v) return e } func (e *htmlArea) Hidden(v bool) HTMLArea { e.setAttr("hidden", v) return e } func (e *htmlArea) Href(v string) HTMLArea { e.setAttr("href", v) return e } func (e *htmlArea) HrefLang(v string) HTMLArea { e.setAttr("hreflang", v) return e } func (e *htmlArea) ID(v string) HTMLArea { e.setAttr("id", v) return e } func (e *htmlArea) Lang(v string) HTMLArea { e.setAttr("lang", v) return e } func (e *htmlArea) Media(v string) HTMLArea { e.setAttr("media", v) return e } func (e *htmlArea) Rel(v string) HTMLArea { e.setAttr("rel", v) return e } func (e *htmlArea) Role(v string) HTMLArea { e.setAttr("role", v) return e } func (e *htmlArea) Shape(v string) HTMLArea { e.setAttr("shape", v) return e } func (e *htmlArea) Spellcheck(v bool) HTMLArea { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlArea) Style(k, v string) HTMLArea { e.setAttr("style", k+":"+v) return e } func (e *htmlArea) Styles(s map[string]string) HTMLArea { for k, v := range s { e.Style(k, v) } return e } func (e *htmlArea) TabIndex(v int) HTMLArea { e.setAttr("tabindex", v) return e } func (e *htmlArea) Target(v string) HTMLArea { e.setAttr("target", v) return e } func (e *htmlArea) Title(v string) HTMLArea { e.setAttr("title", v) return e } func (e *htmlArea) Type(v string) HTMLArea { e.setAttr("type", v) return e } func (e *htmlArea) On(event string, h EventHandler, scope ...any) HTMLArea { e.setEventHandler(event, h, scope...) return e } func (e *htmlArea) OnBlur(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("blur", h, scope...) return e } func (e *htmlArea) OnChange(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("change", h, scope...) return e } func (e *htmlArea) OnClick(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("click", h, scope...) return e } func (e *htmlArea) OnContextMenu(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlArea) OnCopy(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("copy", h, scope...) return e } func (e *htmlArea) OnCut(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("cut", h, scope...) return e } func (e *htmlArea) OnDblClick(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlArea) OnDrag(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("drag", h, scope...) return e } func (e *htmlArea) OnDragEnd(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlArea) OnDragEnter(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlArea) OnDragLeave(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlArea) OnDragOver(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlArea) OnDragStart(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlArea) OnDrop(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("drop", h, scope...) return e } func (e *htmlArea) OnFocus(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("focus", h, scope...) return e } func (e *htmlArea) OnInput(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("input", h, scope...) return e } func (e *htmlArea) OnInvalid(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlArea) OnKeyDown(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlArea) OnKeyPress(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlArea) OnKeyUp(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlArea) OnMouseDown(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlArea) OnMouseMove(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlArea) OnMouseOut(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlArea) OnMouseOver(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlArea) OnMouseUp(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlArea) OnPaste(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("paste", h, scope...) return e } func (e *htmlArea) OnReset(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("reset", h, scope...) return e } func (e *htmlArea) OnScroll(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlArea) OnSearch(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("search", h, scope...) return e } func (e *htmlArea) OnSelect(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("select", h, scope...) return e } func (e *htmlArea) OnSubmit(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("submit", h, scope...) return e } func (e *htmlArea) OnWheel(h EventHandler, scope ...any) HTMLArea { e.setEventHandler("wheel", h, scope...) return e } // HTMLArticle is the interface that describes a "article" HTML element. type HTMLArticle interface { UI // Body set the content of the element. Body(elems ...UI) HTMLArticle // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLArticle // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLArticle // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLArticle // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLArticle // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLArticle // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLArticle // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLArticle // Dir specifies the text direction for the content in an element. Dir(v string) HTMLArticle // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLArticle // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLArticle // ID specifies a unique id for an element. ID(v string) HTMLArticle // Lang specifies the language of the element's content. Lang(v string) HTMLArticle // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLArticle // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLArticle // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLArticle // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLArticle // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLArticle // Title specifies extra information about an element. Title(v string) HTMLArticle // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLArticle // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLArticle // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLArticle // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLArticle // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLArticle // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLArticle // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLArticle // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLArticle // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLArticle // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLArticle // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLArticle // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLArticle // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLArticle // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLArticle // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLArticle // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLArticle // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLArticle // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLArticle // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLArticle // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLArticle // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLArticle // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLArticle // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLArticle // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLArticle // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLArticle // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLArticle // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLArticle // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLArticle // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLArticle // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLArticle // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLArticle // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLArticle // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLArticle } // Article returns an HTML element that defines an article. func Article() HTMLArticle { e := &htmlArticle{ htmlElement: htmlElement{ tag: "article", isSelfClosing: false, }, } return e } type htmlArticle struct { htmlElement } func (e *htmlArticle) Body(v ...UI) HTMLArticle { e.setChildren(v...) return e } func (e *htmlArticle) Text(v any) HTMLArticle { return e.Body(Text(v)) } func (e *htmlArticle) AccessKey(v string) HTMLArticle { e.setAttr("accesskey", v) return e } func (e *htmlArticle) Aria(k string, v any) HTMLArticle { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlArticle) Attr(n string, v any) HTMLArticle { e.setAttr(n, v) return e } func (e *htmlArticle) Class(v ...string) HTMLArticle { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlArticle) ContentEditable(v bool) HTMLArticle { e.setAttr("contenteditable", v) return e } func (e *htmlArticle) DataSet(k string, v any) HTMLArticle { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlArticle) Dir(v string) HTMLArticle { e.setAttr("dir", v) return e } func (e *htmlArticle) Draggable(v bool) HTMLArticle { e.setAttr("draggable", v) return e } func (e *htmlArticle) Hidden(v bool) HTMLArticle { e.setAttr("hidden", v) return e } func (e *htmlArticle) ID(v string) HTMLArticle { e.setAttr("id", v) return e } func (e *htmlArticle) Lang(v string) HTMLArticle { e.setAttr("lang", v) return e } func (e *htmlArticle) Role(v string) HTMLArticle { e.setAttr("role", v) return e } func (e *htmlArticle) Spellcheck(v bool) HTMLArticle { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlArticle) Style(k, v string) HTMLArticle { e.setAttr("style", k+":"+v) return e } func (e *htmlArticle) Styles(s map[string]string) HTMLArticle { for k, v := range s { e.Style(k, v) } return e } func (e *htmlArticle) TabIndex(v int) HTMLArticle { e.setAttr("tabindex", v) return e } func (e *htmlArticle) Title(v string) HTMLArticle { e.setAttr("title", v) return e } func (e *htmlArticle) On(event string, h EventHandler, scope ...any) HTMLArticle { e.setEventHandler(event, h, scope...) return e } func (e *htmlArticle) OnBlur(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("blur", h, scope...) return e } func (e *htmlArticle) OnChange(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("change", h, scope...) return e } func (e *htmlArticle) OnClick(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("click", h, scope...) return e } func (e *htmlArticle) OnContextMenu(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlArticle) OnCopy(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("copy", h, scope...) return e } func (e *htmlArticle) OnCut(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("cut", h, scope...) return e } func (e *htmlArticle) OnDblClick(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlArticle) OnDrag(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("drag", h, scope...) return e } func (e *htmlArticle) OnDragEnd(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlArticle) OnDragEnter(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlArticle) OnDragLeave(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlArticle) OnDragOver(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlArticle) OnDragStart(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlArticle) OnDrop(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("drop", h, scope...) return e } func (e *htmlArticle) OnFocus(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("focus", h, scope...) return e } func (e *htmlArticle) OnInput(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("input", h, scope...) return e } func (e *htmlArticle) OnInvalid(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlArticle) OnKeyDown(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlArticle) OnKeyPress(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlArticle) OnKeyUp(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlArticle) OnMouseDown(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlArticle) OnMouseMove(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlArticle) OnMouseOut(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlArticle) OnMouseOver(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlArticle) OnMouseUp(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlArticle) OnPaste(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("paste", h, scope...) return e } func (e *htmlArticle) OnReset(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("reset", h, scope...) return e } func (e *htmlArticle) OnScroll(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlArticle) OnSearch(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("search", h, scope...) return e } func (e *htmlArticle) OnSelect(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("select", h, scope...) return e } func (e *htmlArticle) OnSubmit(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("submit", h, scope...) return e } func (e *htmlArticle) OnWheel(h EventHandler, scope ...any) HTMLArticle { e.setEventHandler("wheel", h, scope...) return e } // HTMLAside is the interface that describes a "aside" HTML element. type HTMLAside interface { UI // Body set the content of the element. Body(elems ...UI) HTMLAside // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLAside // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLAside // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLAside // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLAside // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLAside // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLAside // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLAside // Dir specifies the text direction for the content in an element. Dir(v string) HTMLAside // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLAside // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLAside // ID specifies a unique id for an element. ID(v string) HTMLAside // Lang specifies the language of the element's content. Lang(v string) HTMLAside // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLAside // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLAside // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLAside // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLAside // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLAside // Title specifies extra information about an element. Title(v string) HTMLAside // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLAside // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLAside // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLAside // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLAside // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLAside // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLAside // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLAside // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLAside // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLAside // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLAside // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLAside // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLAside // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLAside // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLAside // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLAside // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLAside // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLAside // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLAside // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLAside // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLAside // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLAside // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLAside // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLAside // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLAside // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLAside // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLAside // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLAside // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLAside // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLAside // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLAside // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLAside // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLAside // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLAside } // Aside returns an HTML element that defines content aside from the page content. func Aside() HTMLAside { e := &htmlAside{ htmlElement: htmlElement{ tag: "aside", isSelfClosing: false, }, } return e } type htmlAside struct { htmlElement } func (e *htmlAside) Body(v ...UI) HTMLAside { e.setChildren(v...) return e } func (e *htmlAside) Text(v any) HTMLAside { return e.Body(Text(v)) } func (e *htmlAside) AccessKey(v string) HTMLAside { e.setAttr("accesskey", v) return e } func (e *htmlAside) Aria(k string, v any) HTMLAside { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAside) Attr(n string, v any) HTMLAside { e.setAttr(n, v) return e } func (e *htmlAside) Class(v ...string) HTMLAside { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlAside) ContentEditable(v bool) HTMLAside { e.setAttr("contenteditable", v) return e } func (e *htmlAside) DataSet(k string, v any) HTMLAside { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAside) Dir(v string) HTMLAside { e.setAttr("dir", v) return e } func (e *htmlAside) Draggable(v bool) HTMLAside { e.setAttr("draggable", v) return e } func (e *htmlAside) Hidden(v bool) HTMLAside { e.setAttr("hidden", v) return e } func (e *htmlAside) ID(v string) HTMLAside { e.setAttr("id", v) return e } func (e *htmlAside) Lang(v string) HTMLAside { e.setAttr("lang", v) return e } func (e *htmlAside) Role(v string) HTMLAside { e.setAttr("role", v) return e } func (e *htmlAside) Spellcheck(v bool) HTMLAside { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlAside) Style(k, v string) HTMLAside { e.setAttr("style", k+":"+v) return e } func (e *htmlAside) Styles(s map[string]string) HTMLAside { for k, v := range s { e.Style(k, v) } return e } func (e *htmlAside) TabIndex(v int) HTMLAside { e.setAttr("tabindex", v) return e } func (e *htmlAside) Title(v string) HTMLAside { e.setAttr("title", v) return e } func (e *htmlAside) On(event string, h EventHandler, scope ...any) HTMLAside { e.setEventHandler(event, h, scope...) return e } func (e *htmlAside) OnBlur(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("blur", h, scope...) return e } func (e *htmlAside) OnChange(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("change", h, scope...) return e } func (e *htmlAside) OnClick(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("click", h, scope...) return e } func (e *htmlAside) OnContextMenu(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlAside) OnCopy(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("copy", h, scope...) return e } func (e *htmlAside) OnCut(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("cut", h, scope...) return e } func (e *htmlAside) OnDblClick(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlAside) OnDrag(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("drag", h, scope...) return e } func (e *htmlAside) OnDragEnd(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlAside) OnDragEnter(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlAside) OnDragLeave(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlAside) OnDragOver(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlAside) OnDragStart(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlAside) OnDrop(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("drop", h, scope...) return e } func (e *htmlAside) OnFocus(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("focus", h, scope...) return e } func (e *htmlAside) OnInput(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("input", h, scope...) return e } func (e *htmlAside) OnInvalid(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlAside) OnKeyDown(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlAside) OnKeyPress(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlAside) OnKeyUp(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlAside) OnMouseDown(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlAside) OnMouseMove(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlAside) OnMouseOut(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlAside) OnMouseOver(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlAside) OnMouseUp(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlAside) OnPaste(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("paste", h, scope...) return e } func (e *htmlAside) OnReset(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("reset", h, scope...) return e } func (e *htmlAside) OnScroll(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlAside) OnSearch(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("search", h, scope...) return e } func (e *htmlAside) OnSelect(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("select", h, scope...) return e } func (e *htmlAside) OnSubmit(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("submit", h, scope...) return e } func (e *htmlAside) OnWheel(h EventHandler, scope ...any) HTMLAside { e.setEventHandler("wheel", h, scope...) return e } // HTMLAudio is the interface that describes a "audio" HTML element. type HTMLAudio interface { UI // Body set the content of the element. Body(elems ...UI) HTMLAudio // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLAudio // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLAudio // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLAudio // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLAudio // AutoPlay specifies that the audio/video will start playing as soon as it is ready. AutoPlay(v bool) HTMLAudio // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLAudio // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLAudio // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc). Controls(v bool) HTMLAudio // CrossOrigin sets the mode of the request to an HTTP CORS Request. CrossOrigin(v string) HTMLAudio // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLAudio // Dir specifies the text direction for the content in an element. Dir(v string) HTMLAudio // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLAudio // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLAudio // ID specifies a unique id for an element. ID(v string) HTMLAudio // Lang specifies the language of the element's content. Lang(v string) HTMLAudio // Loop specifies that the audio/video will start over again, every time it is finished. Loop(v bool) HTMLAudio // Muted specifies that the audio output of the video should be muted. Muted(v bool) HTMLAudio // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads. Preload(v string) HTMLAudio // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLAudio // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLAudio // Src specifies the URL of the media file. Src(v string) HTMLAudio // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLAudio // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLAudio // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLAudio // Title specifies extra information about an element. Title(v string) HTMLAudio // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLAudio // OnAbort calls the given handler on abort. OnAbort(h EventHandler, scope ...any) HTMLAudio // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLAudio // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin). OnCanPlay(h EventHandler, scope ...any) HTMLAudio // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering. OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLAudio // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLAudio // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLAudio // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLAudio // OnCueChange calls the given handler when the cue changes in a track element. OnCueChange(h EventHandler, scope ...any) HTMLAudio // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLAudio // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLAudio // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLAudio // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLAudio // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLAudio // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLAudio // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLAudio // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLAudio // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLAudio // OnDurationChange calls the given handler when the length of the media changes. OnDurationChange(h EventHandler, scope ...any) HTMLAudio // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects). OnEmptied(h EventHandler, scope ...any) HTMLAudio // OnEnded calls the given handler when the media has reach the end. OnEnded(h EventHandler, scope ...any) HTMLAudio // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLAudio // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLAudio // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLAudio // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLAudio // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLAudio // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLAudio // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLAudio // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded. OnLoadStart(h EventHandler, scope ...any) HTMLAudio // OnLoadedData calls the given handler when media data is loaded. OnLoadedData(h EventHandler, scope ...any) HTMLAudio // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded. OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLAudio // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLAudio // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLAudio // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLAudio // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLAudio // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLAudio // OnPause calls the given handler when the media is paused either by the user or programmatically. OnPause(h EventHandler, scope ...any) HTMLAudio // OnPlay calls the given handler when the media is ready to start playing. OnPlay(h EventHandler, scope ...any) HTMLAudio // OnPlaying calls the given handler when the media actually has started playing. OnPlaying(h EventHandler, scope ...any) HTMLAudio // OnProgress calls the given handler when the browser is in the process of getting the media data. OnProgress(h EventHandler, scope ...any) HTMLAudio // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). OnRateChange(h EventHandler, scope ...any) HTMLAudio // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLAudio // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLAudio // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLAudio // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended. OnSeeked(h EventHandler, scope ...any) HTMLAudio // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active. OnSeeking(h EventHandler, scope ...any) HTMLAudio // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLAudio // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason. OnStalled(h EventHandler, scope ...any) HTMLAudio // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLAudio // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason. OnSuspend(h EventHandler, scope ...any) HTMLAudio // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media). OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute"). OnVolumeChange(h EventHandler, scope ...any) HTMLAudio // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data). OnWaiting(h EventHandler, scope ...any) HTMLAudio // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLAudio } // Audio returns an HTML element that defines sound content. func Audio() HTMLAudio { e := &htmlAudio{ htmlElement: htmlElement{ tag: "audio", isSelfClosing: false, }, } return e } type htmlAudio struct { htmlElement } func (e *htmlAudio) Body(v ...UI) HTMLAudio { e.setChildren(v...) return e } func (e *htmlAudio) Text(v any) HTMLAudio { return e.Body(Text(v)) } func (e *htmlAudio) AccessKey(v string) HTMLAudio { e.setAttr("accesskey", v) return e } func (e *htmlAudio) Aria(k string, v any) HTMLAudio { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAudio) Attr(n string, v any) HTMLAudio { e.setAttr(n, v) return e } func (e *htmlAudio) AutoPlay(v bool) HTMLAudio { e.setAttr("autoplay", v) return e } func (e *htmlAudio) Class(v ...string) HTMLAudio { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlAudio) ContentEditable(v bool) HTMLAudio { e.setAttr("contenteditable", v) return e } func (e *htmlAudio) Controls(v bool) HTMLAudio { e.setAttr("controls", v) return e } func (e *htmlAudio) CrossOrigin(v string) HTMLAudio { e.setAttr("crossorigin", v) return e } func (e *htmlAudio) DataSet(k string, v any) HTMLAudio { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlAudio) Dir(v string) HTMLAudio { e.setAttr("dir", v) return e } func (e *htmlAudio) Draggable(v bool) HTMLAudio { e.setAttr("draggable", v) return e } func (e *htmlAudio) Hidden(v bool) HTMLAudio { e.setAttr("hidden", v) return e } func (e *htmlAudio) ID(v string) HTMLAudio { e.setAttr("id", v) return e } func (e *htmlAudio) Lang(v string) HTMLAudio { e.setAttr("lang", v) return e } func (e *htmlAudio) Loop(v bool) HTMLAudio { e.setAttr("loop", v) return e } func (e *htmlAudio) Muted(v bool) HTMLAudio { e.setAttr("muted", v) return e } func (e *htmlAudio) Preload(v string) HTMLAudio { e.setAttr("preload", v) return e } func (e *htmlAudio) Role(v string) HTMLAudio { e.setAttr("role", v) return e } func (e *htmlAudio) Spellcheck(v bool) HTMLAudio { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlAudio) Src(v string) HTMLAudio { e.setAttr("src", v) return e } func (e *htmlAudio) Style(k, v string) HTMLAudio { e.setAttr("style", k+":"+v) return e } func (e *htmlAudio) Styles(s map[string]string) HTMLAudio { for k, v := range s { e.Style(k, v) } return e } func (e *htmlAudio) TabIndex(v int) HTMLAudio { e.setAttr("tabindex", v) return e } func (e *htmlAudio) Title(v string) HTMLAudio { e.setAttr("title", v) return e } func (e *htmlAudio) On(event string, h EventHandler, scope ...any) HTMLAudio { e.setEventHandler(event, h, scope...) return e } func (e *htmlAudio) OnAbort(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("abort", h, scope...) return e } func (e *htmlAudio) OnBlur(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("blur", h, scope...) return e } func (e *htmlAudio) OnCanPlay(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("canplay", h, scope...) return e } func (e *htmlAudio) OnCanPlayThrough(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("canplaythrough", h, scope...) return e } func (e *htmlAudio) OnChange(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("change", h, scope...) return e } func (e *htmlAudio) OnClick(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("click", h, scope...) return e } func (e *htmlAudio) OnContextMenu(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlAudio) OnCopy(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("copy", h, scope...) return e } func (e *htmlAudio) OnCueChange(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("cuechange", h, scope...) return e } func (e *htmlAudio) OnCut(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("cut", h, scope...) return e } func (e *htmlAudio) OnDblClick(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlAudio) OnDrag(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("drag", h, scope...) return e } func (e *htmlAudio) OnDragEnd(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlAudio) OnDragEnter(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlAudio) OnDragLeave(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlAudio) OnDragOver(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlAudio) OnDragStart(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlAudio) OnDrop(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("drop", h, scope...) return e } func (e *htmlAudio) OnDurationChange(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("durationchange", h, scope...) return e } func (e *htmlAudio) OnEmptied(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("emptied", h, scope...) return e } func (e *htmlAudio) OnEnded(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("ended", h, scope...) return e } func (e *htmlAudio) OnError(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("error", h, scope...) return e } func (e *htmlAudio) OnFocus(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("focus", h, scope...) return e } func (e *htmlAudio) OnInput(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("input", h, scope...) return e } func (e *htmlAudio) OnInvalid(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlAudio) OnKeyDown(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlAudio) OnKeyPress(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlAudio) OnKeyUp(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlAudio) OnLoadStart(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("loadstart", h, scope...) return e } func (e *htmlAudio) OnLoadedData(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("loadeddata", h, scope...) return e } func (e *htmlAudio) OnLoadedMetaData(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("loadedmetadata", h, scope...) return e } func (e *htmlAudio) OnMouseDown(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlAudio) OnMouseMove(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlAudio) OnMouseOut(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlAudio) OnMouseOver(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlAudio) OnMouseUp(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlAudio) OnPaste(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("paste", h, scope...) return e } func (e *htmlAudio) OnPause(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("pause", h, scope...) return e } func (e *htmlAudio) OnPlay(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("play", h, scope...) return e } func (e *htmlAudio) OnPlaying(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("playing", h, scope...) return e } func (e *htmlAudio) OnProgress(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("progress", h, scope...) return e } func (e *htmlAudio) OnRateChange(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("ratechange", h, scope...) return e } func (e *htmlAudio) OnReset(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("reset", h, scope...) return e } func (e *htmlAudio) OnScroll(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlAudio) OnSearch(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("search", h, scope...) return e } func (e *htmlAudio) OnSeeked(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("seeked", h, scope...) return e } func (e *htmlAudio) OnSeeking(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("seeking", h, scope...) return e } func (e *htmlAudio) OnSelect(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("select", h, scope...) return e } func (e *htmlAudio) OnStalled(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("stalled", h, scope...) return e } func (e *htmlAudio) OnSubmit(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("submit", h, scope...) return e } func (e *htmlAudio) OnSuspend(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("suspend", h, scope...) return e } func (e *htmlAudio) OnTimeUpdate(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("timeupdate", h, scope...) return e } func (e *htmlAudio) OnVolumeChange(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("volumechange", h, scope...) return e } func (e *htmlAudio) OnWaiting(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("waiting", h, scope...) return e } func (e *htmlAudio) OnWheel(h EventHandler, scope ...any) HTMLAudio { e.setEventHandler("wheel", h, scope...) return e } // HTMLB is the interface that describes a "b" HTML element. type HTMLB interface { UI // Body set the content of the element. Body(elems ...UI) HTMLB // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLB // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLB // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLB // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLB // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLB // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLB // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLB // Dir specifies the text direction for the content in an element. Dir(v string) HTMLB // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLB // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLB // ID specifies a unique id for an element. ID(v string) HTMLB // Lang specifies the language of the element's content. Lang(v string) HTMLB // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLB // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLB // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLB // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLB // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLB // Title specifies extra information about an element. Title(v string) HTMLB // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLB // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLB // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLB // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLB // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLB // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLB // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLB // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLB // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLB // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLB // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLB // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLB // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLB // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLB // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLB // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLB // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLB // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLB // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLB // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLB // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLB // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLB // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLB // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLB // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLB // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLB // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLB // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLB // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLB // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLB // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLB // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLB // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLB } // B returns an HTML element that defines bold text. func B() HTMLB { e := &htmlB{ htmlElement: htmlElement{ tag: "b", isSelfClosing: false, }, } return e } type htmlB struct { htmlElement } func (e *htmlB) Body(v ...UI) HTMLB { e.setChildren(v...) return e } func (e *htmlB) Text(v any) HTMLB { return e.Body(Text(v)) } func (e *htmlB) AccessKey(v string) HTMLB { e.setAttr("accesskey", v) return e } func (e *htmlB) Aria(k string, v any) HTMLB { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlB) Attr(n string, v any) HTMLB { e.setAttr(n, v) return e } func (e *htmlB) Class(v ...string) HTMLB { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlB) ContentEditable(v bool) HTMLB { e.setAttr("contenteditable", v) return e } func (e *htmlB) DataSet(k string, v any) HTMLB { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlB) Dir(v string) HTMLB { e.setAttr("dir", v) return e } func (e *htmlB) Draggable(v bool) HTMLB { e.setAttr("draggable", v) return e } func (e *htmlB) Hidden(v bool) HTMLB { e.setAttr("hidden", v) return e } func (e *htmlB) ID(v string) HTMLB { e.setAttr("id", v) return e } func (e *htmlB) Lang(v string) HTMLB { e.setAttr("lang", v) return e } func (e *htmlB) Role(v string) HTMLB { e.setAttr("role", v) return e } func (e *htmlB) Spellcheck(v bool) HTMLB { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlB) Style(k, v string) HTMLB { e.setAttr("style", k+":"+v) return e } func (e *htmlB) Styles(s map[string]string) HTMLB { for k, v := range s { e.Style(k, v) } return e } func (e *htmlB) TabIndex(v int) HTMLB { e.setAttr("tabindex", v) return e } func (e *htmlB) Title(v string) HTMLB { e.setAttr("title", v) return e } func (e *htmlB) On(event string, h EventHandler, scope ...any) HTMLB { e.setEventHandler(event, h, scope...) return e } func (e *htmlB) OnBlur(h EventHandler, scope ...any) HTMLB { e.setEventHandler("blur", h, scope...) return e } func (e *htmlB) OnChange(h EventHandler, scope ...any) HTMLB { e.setEventHandler("change", h, scope...) return e } func (e *htmlB) OnClick(h EventHandler, scope ...any) HTMLB { e.setEventHandler("click", h, scope...) return e } func (e *htmlB) OnContextMenu(h EventHandler, scope ...any) HTMLB { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlB) OnCopy(h EventHandler, scope ...any) HTMLB { e.setEventHandler("copy", h, scope...) return e } func (e *htmlB) OnCut(h EventHandler, scope ...any) HTMLB { e.setEventHandler("cut", h, scope...) return e } func (e *htmlB) OnDblClick(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlB) OnDrag(h EventHandler, scope ...any) HTMLB { e.setEventHandler("drag", h, scope...) return e } func (e *htmlB) OnDragEnd(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlB) OnDragEnter(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlB) OnDragLeave(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlB) OnDragOver(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlB) OnDragStart(h EventHandler, scope ...any) HTMLB { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlB) OnDrop(h EventHandler, scope ...any) HTMLB { e.setEventHandler("drop", h, scope...) return e } func (e *htmlB) OnFocus(h EventHandler, scope ...any) HTMLB { e.setEventHandler("focus", h, scope...) return e } func (e *htmlB) OnInput(h EventHandler, scope ...any) HTMLB { e.setEventHandler("input", h, scope...) return e } func (e *htmlB) OnInvalid(h EventHandler, scope ...any) HTMLB { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlB) OnKeyDown(h EventHandler, scope ...any) HTMLB { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlB) OnKeyPress(h EventHandler, scope ...any) HTMLB { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlB) OnKeyUp(h EventHandler, scope ...any) HTMLB { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlB) OnMouseDown(h EventHandler, scope ...any) HTMLB { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlB) OnMouseMove(h EventHandler, scope ...any) HTMLB { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlB) OnMouseOut(h EventHandler, scope ...any) HTMLB { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlB) OnMouseOver(h EventHandler, scope ...any) HTMLB { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlB) OnMouseUp(h EventHandler, scope ...any) HTMLB { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlB) OnPaste(h EventHandler, scope ...any) HTMLB { e.setEventHandler("paste", h, scope...) return e } func (e *htmlB) OnReset(h EventHandler, scope ...any) HTMLB { e.setEventHandler("reset", h, scope...) return e } func (e *htmlB) OnScroll(h EventHandler, scope ...any) HTMLB { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlB) OnSearch(h EventHandler, scope ...any) HTMLB { e.setEventHandler("search", h, scope...) return e } func (e *htmlB) OnSelect(h EventHandler, scope ...any) HTMLB { e.setEventHandler("select", h, scope...) return e } func (e *htmlB) OnSubmit(h EventHandler, scope ...any) HTMLB { e.setEventHandler("submit", h, scope...) return e } func (e *htmlB) OnWheel(h EventHandler, scope ...any) HTMLB { e.setEventHandler("wheel", h, scope...) return e } // HTMLBase is the interface that describes a "base" HTML element. type HTMLBase interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBase // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBase // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBase // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBase // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBase // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBase // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBase // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBase // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBase // Href specifies the URL of the page the link goes to. Href(v string) HTMLBase // ID specifies a unique id for an element. ID(v string) HTMLBase // Lang specifies the language of the element's content. Lang(v string) HTMLBase // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBase // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBase // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBase // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBase // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBase // Target specifies the target for where to open the linked document or where to submit the form. Target(v string) HTMLBase // Title specifies extra information about an element. Title(v string) HTMLBase // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBase // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBase // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBase // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBase // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBase // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBase // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBase // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBase // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBase // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBase // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBase // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBase // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBase // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBase // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBase // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBase // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBase // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBase // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBase // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBase // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBase // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBase // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBase // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBase // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBase // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBase // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBase // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBase // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBase // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBase // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBase // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBase // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBase } // Base returns an HTML element that specifies the base URL/target for all relative URLs in a document. func Base() HTMLBase { e := &htmlBase{ htmlElement: htmlElement{ tag: "base", isSelfClosing: true, }, } return e } type htmlBase struct { htmlElement } func (e *htmlBase) AccessKey(v string) HTMLBase { e.setAttr("accesskey", v) return e } func (e *htmlBase) Aria(k string, v any) HTMLBase { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBase) Attr(n string, v any) HTMLBase { e.setAttr(n, v) return e } func (e *htmlBase) Class(v ...string) HTMLBase { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBase) ContentEditable(v bool) HTMLBase { e.setAttr("contenteditable", v) return e } func (e *htmlBase) DataSet(k string, v any) HTMLBase { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBase) Dir(v string) HTMLBase { e.setAttr("dir", v) return e } func (e *htmlBase) Draggable(v bool) HTMLBase { e.setAttr("draggable", v) return e } func (e *htmlBase) Hidden(v bool) HTMLBase { e.setAttr("hidden", v) return e } func (e *htmlBase) Href(v string) HTMLBase { e.setAttr("href", v) return e } func (e *htmlBase) ID(v string) HTMLBase { e.setAttr("id", v) return e } func (e *htmlBase) Lang(v string) HTMLBase { e.setAttr("lang", v) return e } func (e *htmlBase) Role(v string) HTMLBase { e.setAttr("role", v) return e } func (e *htmlBase) Spellcheck(v bool) HTMLBase { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBase) Style(k, v string) HTMLBase { e.setAttr("style", k+":"+v) return e } func (e *htmlBase) Styles(s map[string]string) HTMLBase { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBase) TabIndex(v int) HTMLBase { e.setAttr("tabindex", v) return e } func (e *htmlBase) Target(v string) HTMLBase { e.setAttr("target", v) return e } func (e *htmlBase) Title(v string) HTMLBase { e.setAttr("title", v) return e } func (e *htmlBase) On(event string, h EventHandler, scope ...any) HTMLBase { e.setEventHandler(event, h, scope...) return e } func (e *htmlBase) OnBlur(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBase) OnChange(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("change", h, scope...) return e } func (e *htmlBase) OnClick(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("click", h, scope...) return e } func (e *htmlBase) OnContextMenu(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBase) OnCopy(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBase) OnCut(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBase) OnDblClick(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBase) OnDrag(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBase) OnDragEnd(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBase) OnDragEnter(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBase) OnDragLeave(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBase) OnDragOver(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBase) OnDragStart(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBase) OnDrop(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBase) OnFocus(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBase) OnInput(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("input", h, scope...) return e } func (e *htmlBase) OnInvalid(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBase) OnKeyDown(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBase) OnKeyPress(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBase) OnKeyUp(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBase) OnMouseDown(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBase) OnMouseMove(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBase) OnMouseOut(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBase) OnMouseOver(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBase) OnMouseUp(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBase) OnPaste(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBase) OnReset(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBase) OnScroll(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBase) OnSearch(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("search", h, scope...) return e } func (e *htmlBase) OnSelect(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("select", h, scope...) return e } func (e *htmlBase) OnSubmit(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBase) OnWheel(h EventHandler, scope ...any) HTMLBase { e.setEventHandler("wheel", h, scope...) return e } // HTMLBdi is the interface that describes a "bdi" HTML element. type HTMLBdi interface { UI // Body set the content of the element. Body(elems ...UI) HTMLBdi // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLBdi // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBdi // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBdi // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBdi // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBdi // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBdi // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBdi // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBdi // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBdi // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBdi // ID specifies a unique id for an element. ID(v string) HTMLBdi // Lang specifies the language of the element's content. Lang(v string) HTMLBdi // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBdi // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBdi // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBdi // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBdi // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBdi // Title specifies extra information about an element. Title(v string) HTMLBdi // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBdi // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBdi // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBdi // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBdi // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBdi // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBdi // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBdi // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBdi // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBdi // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBdi // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBdi // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBdi // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBdi // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBdi // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBdi // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBdi // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBdi // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBdi // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBdi // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBdi // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBdi // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBdi // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBdi // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBdi // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBdi // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBdi // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBdi // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBdi // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBdi // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBdi // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBdi // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBdi // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBdi } // Bdi returns an HTML element that isolates a part of text that might be formatted in a different direction from other text outside it. func Bdi() HTMLBdi { e := &htmlBdi{ htmlElement: htmlElement{ tag: "bdi", isSelfClosing: false, }, } return e } type htmlBdi struct { htmlElement } func (e *htmlBdi) Body(v ...UI) HTMLBdi { e.setChildren(v...) return e } func (e *htmlBdi) Text(v any) HTMLBdi { return e.Body(Text(v)) } func (e *htmlBdi) AccessKey(v string) HTMLBdi { e.setAttr("accesskey", v) return e } func (e *htmlBdi) Aria(k string, v any) HTMLBdi { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBdi) Attr(n string, v any) HTMLBdi { e.setAttr(n, v) return e } func (e *htmlBdi) Class(v ...string) HTMLBdi { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBdi) ContentEditable(v bool) HTMLBdi { e.setAttr("contenteditable", v) return e } func (e *htmlBdi) DataSet(k string, v any) HTMLBdi { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBdi) Dir(v string) HTMLBdi { e.setAttr("dir", v) return e } func (e *htmlBdi) Draggable(v bool) HTMLBdi { e.setAttr("draggable", v) return e } func (e *htmlBdi) Hidden(v bool) HTMLBdi { e.setAttr("hidden", v) return e } func (e *htmlBdi) ID(v string) HTMLBdi { e.setAttr("id", v) return e } func (e *htmlBdi) Lang(v string) HTMLBdi { e.setAttr("lang", v) return e } func (e *htmlBdi) Role(v string) HTMLBdi { e.setAttr("role", v) return e } func (e *htmlBdi) Spellcheck(v bool) HTMLBdi { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBdi) Style(k, v string) HTMLBdi { e.setAttr("style", k+":"+v) return e } func (e *htmlBdi) Styles(s map[string]string) HTMLBdi { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBdi) TabIndex(v int) HTMLBdi { e.setAttr("tabindex", v) return e } func (e *htmlBdi) Title(v string) HTMLBdi { e.setAttr("title", v) return e } func (e *htmlBdi) On(event string, h EventHandler, scope ...any) HTMLBdi { e.setEventHandler(event, h, scope...) return e } func (e *htmlBdi) OnBlur(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBdi) OnChange(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("change", h, scope...) return e } func (e *htmlBdi) OnClick(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("click", h, scope...) return e } func (e *htmlBdi) OnContextMenu(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBdi) OnCopy(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBdi) OnCut(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBdi) OnDblClick(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBdi) OnDrag(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBdi) OnDragEnd(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBdi) OnDragEnter(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBdi) OnDragLeave(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBdi) OnDragOver(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBdi) OnDragStart(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBdi) OnDrop(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBdi) OnFocus(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBdi) OnInput(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("input", h, scope...) return e } func (e *htmlBdi) OnInvalid(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBdi) OnKeyDown(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBdi) OnKeyPress(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBdi) OnKeyUp(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBdi) OnMouseDown(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBdi) OnMouseMove(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBdi) OnMouseOut(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBdi) OnMouseOver(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBdi) OnMouseUp(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBdi) OnPaste(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBdi) OnReset(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBdi) OnScroll(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBdi) OnSearch(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("search", h, scope...) return e } func (e *htmlBdi) OnSelect(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("select", h, scope...) return e } func (e *htmlBdi) OnSubmit(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBdi) OnWheel(h EventHandler, scope ...any) HTMLBdi { e.setEventHandler("wheel", h, scope...) return e } // HTMLBdo is the interface that describes a "bdo" HTML element. type HTMLBdo interface { UI // Body set the content of the element. Body(elems ...UI) HTMLBdo // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLBdo // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBdo // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBdo // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBdo // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBdo // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBdo // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBdo // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBdo // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBdo // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBdo // ID specifies a unique id for an element. ID(v string) HTMLBdo // Lang specifies the language of the element's content. Lang(v string) HTMLBdo // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBdo // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBdo // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBdo // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBdo // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBdo // Title specifies extra information about an element. Title(v string) HTMLBdo // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBdo // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBdo // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBdo // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBdo // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBdo // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBdo // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBdo // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBdo // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBdo // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBdo // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBdo // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBdo // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBdo // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBdo // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBdo // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBdo // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBdo // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBdo // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBdo // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBdo // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBdo // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBdo // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBdo // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBdo // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBdo // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBdo // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBdo // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBdo // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBdo // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBdo // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBdo // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBdo // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBdo } // Bdo returns an HTML element that overrides the current text direction. func Bdo() HTMLBdo { e := &htmlBdo{ htmlElement: htmlElement{ tag: "bdo", isSelfClosing: false, }, } return e } type htmlBdo struct { htmlElement } func (e *htmlBdo) Body(v ...UI) HTMLBdo { e.setChildren(v...) return e } func (e *htmlBdo) Text(v any) HTMLBdo { return e.Body(Text(v)) } func (e *htmlBdo) AccessKey(v string) HTMLBdo { e.setAttr("accesskey", v) return e } func (e *htmlBdo) Aria(k string, v any) HTMLBdo { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBdo) Attr(n string, v any) HTMLBdo { e.setAttr(n, v) return e } func (e *htmlBdo) Class(v ...string) HTMLBdo { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBdo) ContentEditable(v bool) HTMLBdo { e.setAttr("contenteditable", v) return e } func (e *htmlBdo) DataSet(k string, v any) HTMLBdo { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBdo) Dir(v string) HTMLBdo { e.setAttr("dir", v) return e } func (e *htmlBdo) Draggable(v bool) HTMLBdo { e.setAttr("draggable", v) return e } func (e *htmlBdo) Hidden(v bool) HTMLBdo { e.setAttr("hidden", v) return e } func (e *htmlBdo) ID(v string) HTMLBdo { e.setAttr("id", v) return e } func (e *htmlBdo) Lang(v string) HTMLBdo { e.setAttr("lang", v) return e } func (e *htmlBdo) Role(v string) HTMLBdo { e.setAttr("role", v) return e } func (e *htmlBdo) Spellcheck(v bool) HTMLBdo { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBdo) Style(k, v string) HTMLBdo { e.setAttr("style", k+":"+v) return e } func (e *htmlBdo) Styles(s map[string]string) HTMLBdo { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBdo) TabIndex(v int) HTMLBdo { e.setAttr("tabindex", v) return e } func (e *htmlBdo) Title(v string) HTMLBdo { e.setAttr("title", v) return e } func (e *htmlBdo) On(event string, h EventHandler, scope ...any) HTMLBdo { e.setEventHandler(event, h, scope...) return e } func (e *htmlBdo) OnBlur(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBdo) OnChange(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("change", h, scope...) return e } func (e *htmlBdo) OnClick(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("click", h, scope...) return e } func (e *htmlBdo) OnContextMenu(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBdo) OnCopy(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBdo) OnCut(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBdo) OnDblClick(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBdo) OnDrag(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBdo) OnDragEnd(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBdo) OnDragEnter(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBdo) OnDragLeave(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBdo) OnDragOver(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBdo) OnDragStart(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBdo) OnDrop(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBdo) OnFocus(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBdo) OnInput(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("input", h, scope...) return e } func (e *htmlBdo) OnInvalid(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBdo) OnKeyDown(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBdo) OnKeyPress(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBdo) OnKeyUp(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBdo) OnMouseDown(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBdo) OnMouseMove(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBdo) OnMouseOut(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBdo) OnMouseOver(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBdo) OnMouseUp(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBdo) OnPaste(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBdo) OnReset(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBdo) OnScroll(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBdo) OnSearch(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("search", h, scope...) return e } func (e *htmlBdo) OnSelect(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("select", h, scope...) return e } func (e *htmlBdo) OnSubmit(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBdo) OnWheel(h EventHandler, scope ...any) HTMLBdo { e.setEventHandler("wheel", h, scope...) return e } // HTMLBlockquote is the interface that describes a "blockquote" HTML element. type HTMLBlockquote interface { UI // Body set the content of the element. Body(elems ...UI) HTMLBlockquote // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLBlockquote // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBlockquote // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBlockquote // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBlockquote // Cite specifies a URL which explains the quote/deleted/inserted text. Cite(v string) HTMLBlockquote // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBlockquote // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBlockquote // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBlockquote // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBlockquote // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBlockquote // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBlockquote // ID specifies a unique id for an element. ID(v string) HTMLBlockquote // Lang specifies the language of the element's content. Lang(v string) HTMLBlockquote // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBlockquote // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBlockquote // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBlockquote // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBlockquote // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBlockquote // Title specifies extra information about an element. Title(v string) HTMLBlockquote // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBlockquote // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBlockquote // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBlockquote // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBlockquote // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBlockquote // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBlockquote // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBlockquote // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBlockquote // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBlockquote // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBlockquote // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBlockquote // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBlockquote // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBlockquote // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBlockquote // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBlockquote // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBlockquote // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBlockquote // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBlockquote // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBlockquote // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBlockquote // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBlockquote } // Blockquote returns an HTML element that defines a section that is quoted from another source. func Blockquote() HTMLBlockquote { e := &htmlBlockquote{ htmlElement: htmlElement{ tag: "blockquote", isSelfClosing: false, }, } return e } type htmlBlockquote struct { htmlElement } func (e *htmlBlockquote) Body(v ...UI) HTMLBlockquote { e.setChildren(v...) return e } func (e *htmlBlockquote) Text(v any) HTMLBlockquote { return e.Body(Text(v)) } func (e *htmlBlockquote) AccessKey(v string) HTMLBlockquote { e.setAttr("accesskey", v) return e } func (e *htmlBlockquote) Aria(k string, v any) HTMLBlockquote { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBlockquote) Attr(n string, v any) HTMLBlockquote { e.setAttr(n, v) return e } func (e *htmlBlockquote) Cite(v string) HTMLBlockquote { e.setAttr("cite", v) return e } func (e *htmlBlockquote) Class(v ...string) HTMLBlockquote { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBlockquote) ContentEditable(v bool) HTMLBlockquote { e.setAttr("contenteditable", v) return e } func (e *htmlBlockquote) DataSet(k string, v any) HTMLBlockquote { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBlockquote) Dir(v string) HTMLBlockquote { e.setAttr("dir", v) return e } func (e *htmlBlockquote) Draggable(v bool) HTMLBlockquote { e.setAttr("draggable", v) return e } func (e *htmlBlockquote) Hidden(v bool) HTMLBlockquote { e.setAttr("hidden", v) return e } func (e *htmlBlockquote) ID(v string) HTMLBlockquote { e.setAttr("id", v) return e } func (e *htmlBlockquote) Lang(v string) HTMLBlockquote { e.setAttr("lang", v) return e } func (e *htmlBlockquote) Role(v string) HTMLBlockquote { e.setAttr("role", v) return e } func (e *htmlBlockquote) Spellcheck(v bool) HTMLBlockquote { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBlockquote) Style(k, v string) HTMLBlockquote { e.setAttr("style", k+":"+v) return e } func (e *htmlBlockquote) Styles(s map[string]string) HTMLBlockquote { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBlockquote) TabIndex(v int) HTMLBlockquote { e.setAttr("tabindex", v) return e } func (e *htmlBlockquote) Title(v string) HTMLBlockquote { e.setAttr("title", v) return e } func (e *htmlBlockquote) On(event string, h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler(event, h, scope...) return e } func (e *htmlBlockquote) OnBlur(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBlockquote) OnChange(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("change", h, scope...) return e } func (e *htmlBlockquote) OnClick(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("click", h, scope...) return e } func (e *htmlBlockquote) OnContextMenu(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBlockquote) OnCopy(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBlockquote) OnCut(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBlockquote) OnDblClick(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBlockquote) OnDrag(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBlockquote) OnDragEnd(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBlockquote) OnDragEnter(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBlockquote) OnDragLeave(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBlockquote) OnDragOver(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBlockquote) OnDragStart(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBlockquote) OnDrop(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBlockquote) OnFocus(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBlockquote) OnInput(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("input", h, scope...) return e } func (e *htmlBlockquote) OnInvalid(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBlockquote) OnKeyDown(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBlockquote) OnKeyPress(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBlockquote) OnKeyUp(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBlockquote) OnMouseDown(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBlockquote) OnMouseMove(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBlockquote) OnMouseOut(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBlockquote) OnMouseOver(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBlockquote) OnMouseUp(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBlockquote) OnPaste(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBlockquote) OnReset(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBlockquote) OnScroll(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBlockquote) OnSearch(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("search", h, scope...) return e } func (e *htmlBlockquote) OnSelect(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("select", h, scope...) return e } func (e *htmlBlockquote) OnSubmit(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBlockquote) OnWheel(h EventHandler, scope ...any) HTMLBlockquote { e.setEventHandler("wheel", h, scope...) return e } // HTMLBody is the interface that describes a "body" HTML element. type HTMLBody interface { UI privateBody(elems ...UI) HTMLBody // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBody // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBody // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBody // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBody // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBody // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBody // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBody // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBody // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBody // ID specifies a unique id for an element. ID(v string) HTMLBody // Lang specifies the language of the element's content. Lang(v string) HTMLBody // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBody // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBody // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBody // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBody // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBody // Title specifies extra information about an element. Title(v string) HTMLBody // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBody // OnAfterPrint runs the given handler after the document is printed. OnAfterPrint(h EventHandler, scope ...any) HTMLBody // OnBeforePrint calls the given handler before the document is printed. OnBeforePrint(h EventHandler, scope ...any) HTMLBody // OnBeforeUnload calls the given handler when the document is about to be unloaded. OnBeforeUnload(h EventHandler, scope ...any) HTMLBody // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBody // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBody // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBody // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBody // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBody // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBody // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBody // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBody // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBody // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBody // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBody // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBody // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBody // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBody // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLBody // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBody // OnHashChange calls the given handler when there has been changes to the anchor part of the a URL. OnHashChange(h EventHandler, scope ...any) HTMLBody // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBody // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBody // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBody // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBody // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBody // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLBody // OnMessage calls then given handler when a message is triggered. OnMessage(h EventHandler, scope ...any) HTMLBody // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBody // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBody // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBody // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBody // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBody // OnOffline calls the given handler when the browser starts to work offline. OnOffline(h EventHandler, scope ...any) HTMLBody // OnOnline calls the given handler when the browser starts to work online. OnOnline(h EventHandler, scope ...any) HTMLBody // OnPageHide calls the given handler when a user navigates away from a page. OnPageHide(h EventHandler, scope ...any) HTMLBody // OnPageShow calls the given handler when a user navigates to a page. OnPageShow(h EventHandler, scope ...any) HTMLBody // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBody // OnPopState calls the given handler when the window's history changes. OnPopState(h EventHandler, scope ...any) HTMLBody // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBody // OnResize calls the given handler when the browser window is resized. OnResize(h EventHandler, scope ...any) HTMLBody // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBody // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBody // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBody // OnStorage calls the given handler when a Web Storage area is updated. OnStorage(h EventHandler, scope ...any) HTMLBody // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBody // OnUnload calls the given handler once a page has unloaded (or the browser window has been closed). OnUnload(h EventHandler, scope ...any) HTMLBody // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBody } // Body returns an HTML element that defines the document's body. func Body() HTMLBody { e := &htmlBody{ htmlElement: htmlElement{ tag: "body", isSelfClosing: false, }, } return e } type htmlBody struct { htmlElement } func (e *htmlBody) privateBody(v ...UI) HTMLBody { e.setChildren(v...) return e } func (e *htmlBody) AccessKey(v string) HTMLBody { e.setAttr("accesskey", v) return e } func (e *htmlBody) Aria(k string, v any) HTMLBody { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBody) Attr(n string, v any) HTMLBody { e.setAttr(n, v) return e } func (e *htmlBody) Class(v ...string) HTMLBody { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBody) ContentEditable(v bool) HTMLBody { e.setAttr("contenteditable", v) return e } func (e *htmlBody) DataSet(k string, v any) HTMLBody { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBody) Dir(v string) HTMLBody { e.setAttr("dir", v) return e } func (e *htmlBody) Draggable(v bool) HTMLBody { e.setAttr("draggable", v) return e } func (e *htmlBody) Hidden(v bool) HTMLBody { e.setAttr("hidden", v) return e } func (e *htmlBody) ID(v string) HTMLBody { e.setAttr("id", v) return e } func (e *htmlBody) Lang(v string) HTMLBody { e.setAttr("lang", v) return e } func (e *htmlBody) Role(v string) HTMLBody { e.setAttr("role", v) return e } func (e *htmlBody) Spellcheck(v bool) HTMLBody { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBody) Style(k, v string) HTMLBody { e.setAttr("style", k+":"+v) return e } func (e *htmlBody) Styles(s map[string]string) HTMLBody { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBody) TabIndex(v int) HTMLBody { e.setAttr("tabindex", v) return e } func (e *htmlBody) Title(v string) HTMLBody { e.setAttr("title", v) return e } func (e *htmlBody) On(event string, h EventHandler, scope ...any) HTMLBody { e.setEventHandler(event, h, scope...) return e } func (e *htmlBody) OnAfterPrint(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("afterprint", h, scope...) return e } func (e *htmlBody) OnBeforePrint(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("beforeprint", h, scope...) return e } func (e *htmlBody) OnBeforeUnload(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("beforeunload", h, scope...) return e } func (e *htmlBody) OnBlur(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBody) OnChange(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("change", h, scope...) return e } func (e *htmlBody) OnClick(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("click", h, scope...) return e } func (e *htmlBody) OnContextMenu(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBody) OnCopy(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBody) OnCut(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBody) OnDblClick(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBody) OnDrag(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBody) OnDragEnd(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBody) OnDragEnter(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBody) OnDragLeave(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBody) OnDragOver(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBody) OnDragStart(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBody) OnDrop(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBody) OnError(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("error", h, scope...) return e } func (e *htmlBody) OnFocus(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBody) OnHashChange(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("hashchange", h, scope...) return e } func (e *htmlBody) OnInput(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("input", h, scope...) return e } func (e *htmlBody) OnInvalid(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBody) OnKeyDown(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBody) OnKeyPress(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBody) OnKeyUp(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBody) OnLoad(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("load", h, scope...) return e } func (e *htmlBody) OnMessage(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("message", h, scope...) return e } func (e *htmlBody) OnMouseDown(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBody) OnMouseMove(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBody) OnMouseOut(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBody) OnMouseOver(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBody) OnMouseUp(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBody) OnOffline(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("offline", h, scope...) return e } func (e *htmlBody) OnOnline(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("online", h, scope...) return e } func (e *htmlBody) OnPageHide(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("pagehide", h, scope...) return e } func (e *htmlBody) OnPageShow(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("pageshow", h, scope...) return e } func (e *htmlBody) OnPaste(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBody) OnPopState(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("popstate", h, scope...) return e } func (e *htmlBody) OnReset(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBody) OnResize(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("resize", h, scope...) return e } func (e *htmlBody) OnScroll(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBody) OnSearch(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("search", h, scope...) return e } func (e *htmlBody) OnSelect(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("select", h, scope...) return e } func (e *htmlBody) OnStorage(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("storage", h, scope...) return e } func (e *htmlBody) OnSubmit(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBody) OnUnload(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("unload", h, scope...) return e } func (e *htmlBody) OnWheel(h EventHandler, scope ...any) HTMLBody { e.setEventHandler("wheel", h, scope...) return e } // HTMLBr is the interface that describes a "br" HTML element. type HTMLBr interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLBr // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLBr // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLBr // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLBr // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLBr // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLBr // Dir specifies the text direction for the content in an element. Dir(v string) HTMLBr // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLBr // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLBr // ID specifies a unique id for an element. ID(v string) HTMLBr // Lang specifies the language of the element's content. Lang(v string) HTMLBr // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLBr // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLBr // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLBr // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLBr // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLBr // Title specifies extra information about an element. Title(v string) HTMLBr // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLBr // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLBr // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLBr // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLBr // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLBr // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLBr // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLBr // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLBr // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLBr // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLBr // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLBr // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLBr // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLBr // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLBr // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLBr // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLBr // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLBr // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLBr // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLBr // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLBr // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLBr // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLBr // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLBr // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLBr // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLBr // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLBr // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLBr // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLBr // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLBr // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLBr // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLBr // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLBr // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLBr } // Br returns an HTML element that defines a single line break. func Br() HTMLBr { e := &htmlBr{ htmlElement: htmlElement{ tag: "br", isSelfClosing: true, }, } return e } type htmlBr struct { htmlElement } func (e *htmlBr) AccessKey(v string) HTMLBr { e.setAttr("accesskey", v) return e } func (e *htmlBr) Aria(k string, v any) HTMLBr { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBr) Attr(n string, v any) HTMLBr { e.setAttr(n, v) return e } func (e *htmlBr) Class(v ...string) HTMLBr { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlBr) ContentEditable(v bool) HTMLBr { e.setAttr("contenteditable", v) return e } func (e *htmlBr) DataSet(k string, v any) HTMLBr { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlBr) Dir(v string) HTMLBr { e.setAttr("dir", v) return e } func (e *htmlBr) Draggable(v bool) HTMLBr { e.setAttr("draggable", v) return e } func (e *htmlBr) Hidden(v bool) HTMLBr { e.setAttr("hidden", v) return e } func (e *htmlBr) ID(v string) HTMLBr { e.setAttr("id", v) return e } func (e *htmlBr) Lang(v string) HTMLBr { e.setAttr("lang", v) return e } func (e *htmlBr) Role(v string) HTMLBr { e.setAttr("role", v) return e } func (e *htmlBr) Spellcheck(v bool) HTMLBr { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlBr) Style(k, v string) HTMLBr { e.setAttr("style", k+":"+v) return e } func (e *htmlBr) Styles(s map[string]string) HTMLBr { for k, v := range s { e.Style(k, v) } return e } func (e *htmlBr) TabIndex(v int) HTMLBr { e.setAttr("tabindex", v) return e } func (e *htmlBr) Title(v string) HTMLBr { e.setAttr("title", v) return e } func (e *htmlBr) On(event string, h EventHandler, scope ...any) HTMLBr { e.setEventHandler(event, h, scope...) return e } func (e *htmlBr) OnBlur(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("blur", h, scope...) return e } func (e *htmlBr) OnChange(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("change", h, scope...) return e } func (e *htmlBr) OnClick(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("click", h, scope...) return e } func (e *htmlBr) OnContextMenu(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlBr) OnCopy(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("copy", h, scope...) return e } func (e *htmlBr) OnCut(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("cut", h, scope...) return e } func (e *htmlBr) OnDblClick(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlBr) OnDrag(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("drag", h, scope...) return e } func (e *htmlBr) OnDragEnd(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlBr) OnDragEnter(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlBr) OnDragLeave(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlBr) OnDragOver(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlBr) OnDragStart(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlBr) OnDrop(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("drop", h, scope...) return e } func (e *htmlBr) OnFocus(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("focus", h, scope...) return e } func (e *htmlBr) OnInput(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("input", h, scope...) return e } func (e *htmlBr) OnInvalid(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlBr) OnKeyDown(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlBr) OnKeyPress(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlBr) OnKeyUp(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlBr) OnMouseDown(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlBr) OnMouseMove(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlBr) OnMouseOut(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlBr) OnMouseOver(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlBr) OnMouseUp(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlBr) OnPaste(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("paste", h, scope...) return e } func (e *htmlBr) OnReset(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("reset", h, scope...) return e } func (e *htmlBr) OnScroll(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlBr) OnSearch(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("search", h, scope...) return e } func (e *htmlBr) OnSelect(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("select", h, scope...) return e } func (e *htmlBr) OnSubmit(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("submit", h, scope...) return e } func (e *htmlBr) OnWheel(h EventHandler, scope ...any) HTMLBr { e.setEventHandler("wheel", h, scope...) return e } // HTMLButton is the interface that describes a "button" HTML element. type HTMLButton interface { UI // Body set the content of the element. Body(elems ...UI) HTMLButton // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLButton // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLButton // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLButton // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLButton // AutoFocus specifies that the element should automatically get focus when the page loads. AutoFocus(v bool) HTMLButton // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLButton // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLButton // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLButton // Dir specifies the text direction for the content in an element. Dir(v string) HTMLButton // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLButton // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLButton // Form specifies the name of the form the element belongs to. Form(v string) HTMLButton // FormAction specifies where to send the form-data when a form is submitted. Only for submit type. FormAction(v string) HTMLButton // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type. FormEncType(v string) HTMLButton // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type. FormMethod(v string) HTMLButton // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type. FormNoValidate(v bool) HTMLButton // FormTarget specifies where to display the response after submitting the form. Only for submit type. FormTarget(v string) HTMLButton // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLButton // ID specifies a unique id for an element. ID(v string) HTMLButton // Lang specifies the language of the element's content. Lang(v string) HTMLButton // Name specifies the name of the element. Name(v string) HTMLButton // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLButton // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLButton // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLButton // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLButton // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLButton // Title specifies extra information about an element. Title(v string) HTMLButton // Type specifies the type of element. Type(v string) HTMLButton // Value specifies the value of the element. Value(v any) HTMLButton // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLButton // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLButton // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLButton // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLButton // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLButton // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLButton // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLButton // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLButton // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLButton // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLButton // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLButton // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLButton // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLButton // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLButton // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLButton // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLButton // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLButton // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLButton // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLButton // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLButton // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLButton // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLButton // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLButton // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLButton // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLButton // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLButton // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLButton // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLButton // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLButton // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLButton // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLButton // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLButton // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLButton } // Button returns an HTML element that defines a clickable button. func Button() HTMLButton { e := &htmlButton{ htmlElement: htmlElement{ tag: "button", isSelfClosing: false, }, } return e } type htmlButton struct { htmlElement } func (e *htmlButton) Body(v ...UI) HTMLButton { e.setChildren(v...) return e } func (e *htmlButton) Text(v any) HTMLButton { return e.Body(Text(v)) } func (e *htmlButton) AccessKey(v string) HTMLButton { e.setAttr("accesskey", v) return e } func (e *htmlButton) Aria(k string, v any) HTMLButton { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlButton) Attr(n string, v any) HTMLButton { e.setAttr(n, v) return e } func (e *htmlButton) AutoFocus(v bool) HTMLButton { e.setAttr("autofocus", v) return e } func (e *htmlButton) Class(v ...string) HTMLButton { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlButton) ContentEditable(v bool) HTMLButton { e.setAttr("contenteditable", v) return e } func (e *htmlButton) DataSet(k string, v any) HTMLButton { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlButton) Dir(v string) HTMLButton { e.setAttr("dir", v) return e } func (e *htmlButton) Disabled(v bool) HTMLButton { e.setAttr("disabled", v) return e } func (e *htmlButton) Draggable(v bool) HTMLButton { e.setAttr("draggable", v) return e } func (e *htmlButton) Form(v string) HTMLButton { e.setAttr("form", v) return e } func (e *htmlButton) FormAction(v string) HTMLButton { e.setAttr("formaction", v) return e } func (e *htmlButton) FormEncType(v string) HTMLButton { e.setAttr("formenctype", v) return e } func (e *htmlButton) FormMethod(v string) HTMLButton { e.setAttr("formmethod", v) return e } func (e *htmlButton) FormNoValidate(v bool) HTMLButton { e.setAttr("formnovalidate", v) return e } func (e *htmlButton) FormTarget(v string) HTMLButton { e.setAttr("formtarget", v) return e } func (e *htmlButton) Hidden(v bool) HTMLButton { e.setAttr("hidden", v) return e } func (e *htmlButton) ID(v string) HTMLButton { e.setAttr("id", v) return e } func (e *htmlButton) Lang(v string) HTMLButton { e.setAttr("lang", v) return e } func (e *htmlButton) Name(v string) HTMLButton { e.setAttr("name", v) return e } func (e *htmlButton) Role(v string) HTMLButton { e.setAttr("role", v) return e } func (e *htmlButton) Spellcheck(v bool) HTMLButton { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlButton) Style(k, v string) HTMLButton { e.setAttr("style", k+":"+v) return e } func (e *htmlButton) Styles(s map[string]string) HTMLButton { for k, v := range s { e.Style(k, v) } return e } func (e *htmlButton) TabIndex(v int) HTMLButton { e.setAttr("tabindex", v) return e } func (e *htmlButton) Title(v string) HTMLButton { e.setAttr("title", v) return e } func (e *htmlButton) Type(v string) HTMLButton { e.setAttr("type", v) return e } func (e *htmlButton) Value(v any) HTMLButton { e.setAttr("value", v) return e } func (e *htmlButton) On(event string, h EventHandler, scope ...any) HTMLButton { e.setEventHandler(event, h, scope...) return e } func (e *htmlButton) OnBlur(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("blur", h, scope...) return e } func (e *htmlButton) OnChange(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("change", h, scope...) return e } func (e *htmlButton) OnClick(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("click", h, scope...) return e } func (e *htmlButton) OnContextMenu(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlButton) OnCopy(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("copy", h, scope...) return e } func (e *htmlButton) OnCut(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("cut", h, scope...) return e } func (e *htmlButton) OnDblClick(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlButton) OnDrag(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("drag", h, scope...) return e } func (e *htmlButton) OnDragEnd(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlButton) OnDragEnter(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlButton) OnDragLeave(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlButton) OnDragOver(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlButton) OnDragStart(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlButton) OnDrop(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("drop", h, scope...) return e } func (e *htmlButton) OnFocus(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("focus", h, scope...) return e } func (e *htmlButton) OnInput(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("input", h, scope...) return e } func (e *htmlButton) OnInvalid(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlButton) OnKeyDown(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlButton) OnKeyPress(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlButton) OnKeyUp(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlButton) OnMouseDown(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlButton) OnMouseMove(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlButton) OnMouseOut(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlButton) OnMouseOver(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlButton) OnMouseUp(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlButton) OnPaste(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("paste", h, scope...) return e } func (e *htmlButton) OnReset(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("reset", h, scope...) return e } func (e *htmlButton) OnScroll(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlButton) OnSearch(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("search", h, scope...) return e } func (e *htmlButton) OnSelect(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("select", h, scope...) return e } func (e *htmlButton) OnSubmit(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("submit", h, scope...) return e } func (e *htmlButton) OnWheel(h EventHandler, scope ...any) HTMLButton { e.setEventHandler("wheel", h, scope...) return e } // HTMLCanvas is the interface that describes a "canvas" HTML element. type HTMLCanvas interface { UI // Body set the content of the element. Body(elems ...UI) HTMLCanvas // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLCanvas // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLCanvas // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLCanvas // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLCanvas // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLCanvas // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLCanvas // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLCanvas // Dir specifies the text direction for the content in an element. Dir(v string) HTMLCanvas // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLCanvas // Height specifies the height of the element (in pixels). Height(v int) HTMLCanvas // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLCanvas // ID specifies a unique id for an element. ID(v string) HTMLCanvas // Lang specifies the language of the element's content. Lang(v string) HTMLCanvas // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLCanvas // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLCanvas // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLCanvas // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLCanvas // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLCanvas // Title specifies extra information about an element. Title(v string) HTMLCanvas // Width specifies the width of the element. Width(v int) HTMLCanvas // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLCanvas // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLCanvas // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLCanvas // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLCanvas // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLCanvas // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLCanvas // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLCanvas // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLCanvas // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLCanvas // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLCanvas // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLCanvas // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLCanvas // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLCanvas // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLCanvas // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLCanvas // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLCanvas // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLCanvas // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLCanvas // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLCanvas // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLCanvas // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLCanvas // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLCanvas // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLCanvas // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLCanvas // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLCanvas // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLCanvas // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLCanvas // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLCanvas // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLCanvas // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLCanvas // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLCanvas // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLCanvas // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLCanvas } // Canvas returns an HTML element that is used to draw graphics on the fly. func Canvas() HTMLCanvas { e := &htmlCanvas{ htmlElement: htmlElement{ tag: "canvas", isSelfClosing: false, }, } return e } type htmlCanvas struct { htmlElement } func (e *htmlCanvas) Body(v ...UI) HTMLCanvas { e.setChildren(v...) return e } func (e *htmlCanvas) Text(v any) HTMLCanvas { return e.Body(Text(v)) } func (e *htmlCanvas) AccessKey(v string) HTMLCanvas { e.setAttr("accesskey", v) return e } func (e *htmlCanvas) Aria(k string, v any) HTMLCanvas { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCanvas) Attr(n string, v any) HTMLCanvas { e.setAttr(n, v) return e } func (e *htmlCanvas) Class(v ...string) HTMLCanvas { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlCanvas) ContentEditable(v bool) HTMLCanvas { e.setAttr("contenteditable", v) return e } func (e *htmlCanvas) DataSet(k string, v any) HTMLCanvas { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCanvas) Dir(v string) HTMLCanvas { e.setAttr("dir", v) return e } func (e *htmlCanvas) Draggable(v bool) HTMLCanvas { e.setAttr("draggable", v) return e } func (e *htmlCanvas) Height(v int) HTMLCanvas { e.setAttr("height", v) return e } func (e *htmlCanvas) Hidden(v bool) HTMLCanvas { e.setAttr("hidden", v) return e } func (e *htmlCanvas) ID(v string) HTMLCanvas { e.setAttr("id", v) return e } func (e *htmlCanvas) Lang(v string) HTMLCanvas { e.setAttr("lang", v) return e } func (e *htmlCanvas) Role(v string) HTMLCanvas { e.setAttr("role", v) return e } func (e *htmlCanvas) Spellcheck(v bool) HTMLCanvas { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlCanvas) Style(k, v string) HTMLCanvas { e.setAttr("style", k+":"+v) return e } func (e *htmlCanvas) Styles(s map[string]string) HTMLCanvas { for k, v := range s { e.Style(k, v) } return e } func (e *htmlCanvas) TabIndex(v int) HTMLCanvas { e.setAttr("tabindex", v) return e } func (e *htmlCanvas) Title(v string) HTMLCanvas { e.setAttr("title", v) return e } func (e *htmlCanvas) Width(v int) HTMLCanvas { e.setAttr("width", v) return e } func (e *htmlCanvas) On(event string, h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler(event, h, scope...) return e } func (e *htmlCanvas) OnBlur(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("blur", h, scope...) return e } func (e *htmlCanvas) OnChange(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("change", h, scope...) return e } func (e *htmlCanvas) OnClick(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("click", h, scope...) return e } func (e *htmlCanvas) OnContextMenu(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlCanvas) OnCopy(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("copy", h, scope...) return e } func (e *htmlCanvas) OnCut(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("cut", h, scope...) return e } func (e *htmlCanvas) OnDblClick(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlCanvas) OnDrag(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("drag", h, scope...) return e } func (e *htmlCanvas) OnDragEnd(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlCanvas) OnDragEnter(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlCanvas) OnDragLeave(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlCanvas) OnDragOver(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlCanvas) OnDragStart(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlCanvas) OnDrop(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("drop", h, scope...) return e } func (e *htmlCanvas) OnFocus(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("focus", h, scope...) return e } func (e *htmlCanvas) OnInput(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("input", h, scope...) return e } func (e *htmlCanvas) OnInvalid(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlCanvas) OnKeyDown(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlCanvas) OnKeyPress(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlCanvas) OnKeyUp(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlCanvas) OnMouseDown(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlCanvas) OnMouseMove(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlCanvas) OnMouseOut(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlCanvas) OnMouseOver(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlCanvas) OnMouseUp(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlCanvas) OnPaste(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("paste", h, scope...) return e } func (e *htmlCanvas) OnReset(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("reset", h, scope...) return e } func (e *htmlCanvas) OnScroll(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlCanvas) OnSearch(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("search", h, scope...) return e } func (e *htmlCanvas) OnSelect(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("select", h, scope...) return e } func (e *htmlCanvas) OnSubmit(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("submit", h, scope...) return e } func (e *htmlCanvas) OnWheel(h EventHandler, scope ...any) HTMLCanvas { e.setEventHandler("wheel", h, scope...) return e } // HTMLCaption is the interface that describes a "caption" HTML element. type HTMLCaption interface { UI // Body set the content of the element. Body(elems ...UI) HTMLCaption // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLCaption // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLCaption // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLCaption // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLCaption // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLCaption // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLCaption // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLCaption // Dir specifies the text direction for the content in an element. Dir(v string) HTMLCaption // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLCaption // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLCaption // ID specifies a unique id for an element. ID(v string) HTMLCaption // Lang specifies the language of the element's content. Lang(v string) HTMLCaption // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLCaption // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLCaption // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLCaption // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLCaption // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLCaption // Title specifies extra information about an element. Title(v string) HTMLCaption // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLCaption // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLCaption // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLCaption // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLCaption // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLCaption // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLCaption // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLCaption // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLCaption // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLCaption // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLCaption // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLCaption // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLCaption // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLCaption // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLCaption // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLCaption // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLCaption // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLCaption // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLCaption // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLCaption // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLCaption // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLCaption // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLCaption // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLCaption // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLCaption // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLCaption // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLCaption // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLCaption // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLCaption // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLCaption // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLCaption // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLCaption // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLCaption // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLCaption } // Caption returns an HTML element that defines a table caption. func Caption() HTMLCaption { e := &htmlCaption{ htmlElement: htmlElement{ tag: "caption", isSelfClosing: false, }, } return e } type htmlCaption struct { htmlElement } func (e *htmlCaption) Body(v ...UI) HTMLCaption { e.setChildren(v...) return e } func (e *htmlCaption) Text(v any) HTMLCaption { return e.Body(Text(v)) } func (e *htmlCaption) AccessKey(v string) HTMLCaption { e.setAttr("accesskey", v) return e } func (e *htmlCaption) Aria(k string, v any) HTMLCaption { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCaption) Attr(n string, v any) HTMLCaption { e.setAttr(n, v) return e } func (e *htmlCaption) Class(v ...string) HTMLCaption { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlCaption) ContentEditable(v bool) HTMLCaption { e.setAttr("contenteditable", v) return e } func (e *htmlCaption) DataSet(k string, v any) HTMLCaption { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCaption) Dir(v string) HTMLCaption { e.setAttr("dir", v) return e } func (e *htmlCaption) Draggable(v bool) HTMLCaption { e.setAttr("draggable", v) return e } func (e *htmlCaption) Hidden(v bool) HTMLCaption { e.setAttr("hidden", v) return e } func (e *htmlCaption) ID(v string) HTMLCaption { e.setAttr("id", v) return e } func (e *htmlCaption) Lang(v string) HTMLCaption { e.setAttr("lang", v) return e } func (e *htmlCaption) Role(v string) HTMLCaption { e.setAttr("role", v) return e } func (e *htmlCaption) Spellcheck(v bool) HTMLCaption { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlCaption) Style(k, v string) HTMLCaption { e.setAttr("style", k+":"+v) return e } func (e *htmlCaption) Styles(s map[string]string) HTMLCaption { for k, v := range s { e.Style(k, v) } return e } func (e *htmlCaption) TabIndex(v int) HTMLCaption { e.setAttr("tabindex", v) return e } func (e *htmlCaption) Title(v string) HTMLCaption { e.setAttr("title", v) return e } func (e *htmlCaption) On(event string, h EventHandler, scope ...any) HTMLCaption { e.setEventHandler(event, h, scope...) return e } func (e *htmlCaption) OnBlur(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("blur", h, scope...) return e } func (e *htmlCaption) OnChange(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("change", h, scope...) return e } func (e *htmlCaption) OnClick(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("click", h, scope...) return e } func (e *htmlCaption) OnContextMenu(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlCaption) OnCopy(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("copy", h, scope...) return e } func (e *htmlCaption) OnCut(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("cut", h, scope...) return e } func (e *htmlCaption) OnDblClick(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlCaption) OnDrag(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("drag", h, scope...) return e } func (e *htmlCaption) OnDragEnd(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlCaption) OnDragEnter(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlCaption) OnDragLeave(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlCaption) OnDragOver(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlCaption) OnDragStart(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlCaption) OnDrop(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("drop", h, scope...) return e } func (e *htmlCaption) OnFocus(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("focus", h, scope...) return e } func (e *htmlCaption) OnInput(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("input", h, scope...) return e } func (e *htmlCaption) OnInvalid(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlCaption) OnKeyDown(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlCaption) OnKeyPress(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlCaption) OnKeyUp(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlCaption) OnMouseDown(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlCaption) OnMouseMove(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlCaption) OnMouseOut(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlCaption) OnMouseOver(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlCaption) OnMouseUp(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlCaption) OnPaste(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("paste", h, scope...) return e } func (e *htmlCaption) OnReset(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("reset", h, scope...) return e } func (e *htmlCaption) OnScroll(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlCaption) OnSearch(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("search", h, scope...) return e } func (e *htmlCaption) OnSelect(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("select", h, scope...) return e } func (e *htmlCaption) OnSubmit(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("submit", h, scope...) return e } func (e *htmlCaption) OnWheel(h EventHandler, scope ...any) HTMLCaption { e.setEventHandler("wheel", h, scope...) return e } // HTMLCite is the interface that describes a "cite" HTML element. type HTMLCite interface { UI // Body set the content of the element. Body(elems ...UI) HTMLCite // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLCite // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLCite // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLCite // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLCite // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLCite // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLCite // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLCite // Dir specifies the text direction for the content in an element. Dir(v string) HTMLCite // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLCite // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLCite // ID specifies a unique id for an element. ID(v string) HTMLCite // Lang specifies the language of the element's content. Lang(v string) HTMLCite // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLCite // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLCite // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLCite // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLCite // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLCite // Title specifies extra information about an element. Title(v string) HTMLCite // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLCite // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLCite // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLCite // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLCite // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLCite // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLCite // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLCite // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLCite // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLCite // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLCite // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLCite // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLCite // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLCite // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLCite // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLCite // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLCite // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLCite // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLCite // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLCite // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLCite // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLCite // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLCite // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLCite // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLCite // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLCite // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLCite // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLCite // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLCite // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLCite // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLCite // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLCite // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLCite // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLCite } // Cite returns an HTML element that defines the title of a work. func Cite() HTMLCite { e := &htmlCite{ htmlElement: htmlElement{ tag: "cite", isSelfClosing: false, }, } return e } type htmlCite struct { htmlElement } func (e *htmlCite) Body(v ...UI) HTMLCite { e.setChildren(v...) return e } func (e *htmlCite) Text(v any) HTMLCite { return e.Body(Text(v)) } func (e *htmlCite) AccessKey(v string) HTMLCite { e.setAttr("accesskey", v) return e } func (e *htmlCite) Aria(k string, v any) HTMLCite { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCite) Attr(n string, v any) HTMLCite { e.setAttr(n, v) return e } func (e *htmlCite) Class(v ...string) HTMLCite { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlCite) ContentEditable(v bool) HTMLCite { e.setAttr("contenteditable", v) return e } func (e *htmlCite) DataSet(k string, v any) HTMLCite { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCite) Dir(v string) HTMLCite { e.setAttr("dir", v) return e } func (e *htmlCite) Draggable(v bool) HTMLCite { e.setAttr("draggable", v) return e } func (e *htmlCite) Hidden(v bool) HTMLCite { e.setAttr("hidden", v) return e } func (e *htmlCite) ID(v string) HTMLCite { e.setAttr("id", v) return e } func (e *htmlCite) Lang(v string) HTMLCite { e.setAttr("lang", v) return e } func (e *htmlCite) Role(v string) HTMLCite { e.setAttr("role", v) return e } func (e *htmlCite) Spellcheck(v bool) HTMLCite { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlCite) Style(k, v string) HTMLCite { e.setAttr("style", k+":"+v) return e } func (e *htmlCite) Styles(s map[string]string) HTMLCite { for k, v := range s { e.Style(k, v) } return e } func (e *htmlCite) TabIndex(v int) HTMLCite { e.setAttr("tabindex", v) return e } func (e *htmlCite) Title(v string) HTMLCite { e.setAttr("title", v) return e } func (e *htmlCite) On(event string, h EventHandler, scope ...any) HTMLCite { e.setEventHandler(event, h, scope...) return e } func (e *htmlCite) OnBlur(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("blur", h, scope...) return e } func (e *htmlCite) OnChange(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("change", h, scope...) return e } func (e *htmlCite) OnClick(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("click", h, scope...) return e } func (e *htmlCite) OnContextMenu(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlCite) OnCopy(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("copy", h, scope...) return e } func (e *htmlCite) OnCut(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("cut", h, scope...) return e } func (e *htmlCite) OnDblClick(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlCite) OnDrag(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("drag", h, scope...) return e } func (e *htmlCite) OnDragEnd(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlCite) OnDragEnter(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlCite) OnDragLeave(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlCite) OnDragOver(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlCite) OnDragStart(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlCite) OnDrop(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("drop", h, scope...) return e } func (e *htmlCite) OnFocus(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("focus", h, scope...) return e } func (e *htmlCite) OnInput(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("input", h, scope...) return e } func (e *htmlCite) OnInvalid(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlCite) OnKeyDown(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlCite) OnKeyPress(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlCite) OnKeyUp(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlCite) OnMouseDown(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlCite) OnMouseMove(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlCite) OnMouseOut(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlCite) OnMouseOver(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlCite) OnMouseUp(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlCite) OnPaste(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("paste", h, scope...) return e } func (e *htmlCite) OnReset(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("reset", h, scope...) return e } func (e *htmlCite) OnScroll(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlCite) OnSearch(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("search", h, scope...) return e } func (e *htmlCite) OnSelect(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("select", h, scope...) return e } func (e *htmlCite) OnSubmit(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("submit", h, scope...) return e } func (e *htmlCite) OnWheel(h EventHandler, scope ...any) HTMLCite { e.setEventHandler("wheel", h, scope...) return e } // HTMLCode is the interface that describes a "code" HTML element. type HTMLCode interface { UI // Body set the content of the element. Body(elems ...UI) HTMLCode // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLCode // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLCode // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLCode // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLCode // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLCode // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLCode // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLCode // Dir specifies the text direction for the content in an element. Dir(v string) HTMLCode // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLCode // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLCode // ID specifies a unique id for an element. ID(v string) HTMLCode // Lang specifies the language of the element's content. Lang(v string) HTMLCode // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLCode // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLCode // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLCode // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLCode // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLCode // Title specifies extra information about an element. Title(v string) HTMLCode // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLCode // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLCode // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLCode // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLCode // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLCode // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLCode // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLCode // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLCode // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLCode // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLCode // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLCode // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLCode // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLCode // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLCode // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLCode // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLCode // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLCode // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLCode // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLCode // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLCode // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLCode // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLCode // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLCode // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLCode // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLCode // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLCode // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLCode // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLCode // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLCode // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLCode // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLCode // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLCode // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLCode } // Code returns an HTML element that defines a piece of computer code. func Code() HTMLCode { e := &htmlCode{ htmlElement: htmlElement{ tag: "code", isSelfClosing: false, }, } return e } type htmlCode struct { htmlElement } func (e *htmlCode) Body(v ...UI) HTMLCode { e.setChildren(v...) return e } func (e *htmlCode) Text(v any) HTMLCode { return e.Body(Text(v)) } func (e *htmlCode) AccessKey(v string) HTMLCode { e.setAttr("accesskey", v) return e } func (e *htmlCode) Aria(k string, v any) HTMLCode { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCode) Attr(n string, v any) HTMLCode { e.setAttr(n, v) return e } func (e *htmlCode) Class(v ...string) HTMLCode { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlCode) ContentEditable(v bool) HTMLCode { e.setAttr("contenteditable", v) return e } func (e *htmlCode) DataSet(k string, v any) HTMLCode { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCode) Dir(v string) HTMLCode { e.setAttr("dir", v) return e } func (e *htmlCode) Draggable(v bool) HTMLCode { e.setAttr("draggable", v) return e } func (e *htmlCode) Hidden(v bool) HTMLCode { e.setAttr("hidden", v) return e } func (e *htmlCode) ID(v string) HTMLCode { e.setAttr("id", v) return e } func (e *htmlCode) Lang(v string) HTMLCode { e.setAttr("lang", v) return e } func (e *htmlCode) Role(v string) HTMLCode { e.setAttr("role", v) return e } func (e *htmlCode) Spellcheck(v bool) HTMLCode { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlCode) Style(k, v string) HTMLCode { e.setAttr("style", k+":"+v) return e } func (e *htmlCode) Styles(s map[string]string) HTMLCode { for k, v := range s { e.Style(k, v) } return e } func (e *htmlCode) TabIndex(v int) HTMLCode { e.setAttr("tabindex", v) return e } func (e *htmlCode) Title(v string) HTMLCode { e.setAttr("title", v) return e } func (e *htmlCode) On(event string, h EventHandler, scope ...any) HTMLCode { e.setEventHandler(event, h, scope...) return e } func (e *htmlCode) OnBlur(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("blur", h, scope...) return e } func (e *htmlCode) OnChange(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("change", h, scope...) return e } func (e *htmlCode) OnClick(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("click", h, scope...) return e } func (e *htmlCode) OnContextMenu(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlCode) OnCopy(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("copy", h, scope...) return e } func (e *htmlCode) OnCut(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("cut", h, scope...) return e } func (e *htmlCode) OnDblClick(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlCode) OnDrag(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("drag", h, scope...) return e } func (e *htmlCode) OnDragEnd(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlCode) OnDragEnter(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlCode) OnDragLeave(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlCode) OnDragOver(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlCode) OnDragStart(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlCode) OnDrop(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("drop", h, scope...) return e } func (e *htmlCode) OnFocus(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("focus", h, scope...) return e } func (e *htmlCode) OnInput(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("input", h, scope...) return e } func (e *htmlCode) OnInvalid(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlCode) OnKeyDown(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlCode) OnKeyPress(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlCode) OnKeyUp(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlCode) OnMouseDown(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlCode) OnMouseMove(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlCode) OnMouseOut(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlCode) OnMouseOver(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlCode) OnMouseUp(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlCode) OnPaste(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("paste", h, scope...) return e } func (e *htmlCode) OnReset(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("reset", h, scope...) return e } func (e *htmlCode) OnScroll(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlCode) OnSearch(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("search", h, scope...) return e } func (e *htmlCode) OnSelect(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("select", h, scope...) return e } func (e *htmlCode) OnSubmit(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("submit", h, scope...) return e } func (e *htmlCode) OnWheel(h EventHandler, scope ...any) HTMLCode { e.setEventHandler("wheel", h, scope...) return e } // HTMLCol is the interface that describes a "col" HTML element. type HTMLCol interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLCol // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLCol // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLCol // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLCol // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLCol // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLCol // Dir specifies the text direction for the content in an element. Dir(v string) HTMLCol // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLCol // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLCol // ID specifies a unique id for an element. ID(v string) HTMLCol // Lang specifies the language of the element's content. Lang(v string) HTMLCol // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLCol // Span specifies the number of columns to span. Span(v int) HTMLCol // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLCol // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLCol // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLCol // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLCol // Title specifies extra information about an element. Title(v string) HTMLCol // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLCol // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLCol // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLCol // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLCol // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLCol // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLCol // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLCol // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLCol // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLCol // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLCol // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLCol // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLCol // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLCol // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLCol // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLCol // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLCol // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLCol // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLCol // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLCol // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLCol // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLCol // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLCol // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLCol // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLCol // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLCol // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLCol // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLCol // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLCol // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLCol // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLCol // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLCol // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLCol // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLCol } // Col returns an HTML element that specifies column properties for each column within a colgroup element. func Col() HTMLCol { e := &htmlCol{ htmlElement: htmlElement{ tag: "col", isSelfClosing: true, }, } return e } type htmlCol struct { htmlElement } func (e *htmlCol) AccessKey(v string) HTMLCol { e.setAttr("accesskey", v) return e } func (e *htmlCol) Aria(k string, v any) HTMLCol { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCol) Attr(n string, v any) HTMLCol { e.setAttr(n, v) return e } func (e *htmlCol) Class(v ...string) HTMLCol { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlCol) ContentEditable(v bool) HTMLCol { e.setAttr("contenteditable", v) return e } func (e *htmlCol) DataSet(k string, v any) HTMLCol { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlCol) Dir(v string) HTMLCol { e.setAttr("dir", v) return e } func (e *htmlCol) Draggable(v bool) HTMLCol { e.setAttr("draggable", v) return e } func (e *htmlCol) Hidden(v bool) HTMLCol { e.setAttr("hidden", v) return e } func (e *htmlCol) ID(v string) HTMLCol { e.setAttr("id", v) return e } func (e *htmlCol) Lang(v string) HTMLCol { e.setAttr("lang", v) return e } func (e *htmlCol) Role(v string) HTMLCol { e.setAttr("role", v) return e } func (e *htmlCol) Span(v int) HTMLCol { e.setAttr("span", v) return e } func (e *htmlCol) Spellcheck(v bool) HTMLCol { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlCol) Style(k, v string) HTMLCol { e.setAttr("style", k+":"+v) return e } func (e *htmlCol) Styles(s map[string]string) HTMLCol { for k, v := range s { e.Style(k, v) } return e } func (e *htmlCol) TabIndex(v int) HTMLCol { e.setAttr("tabindex", v) return e } func (e *htmlCol) Title(v string) HTMLCol { e.setAttr("title", v) return e } func (e *htmlCol) On(event string, h EventHandler, scope ...any) HTMLCol { e.setEventHandler(event, h, scope...) return e } func (e *htmlCol) OnBlur(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("blur", h, scope...) return e } func (e *htmlCol) OnChange(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("change", h, scope...) return e } func (e *htmlCol) OnClick(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("click", h, scope...) return e } func (e *htmlCol) OnContextMenu(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlCol) OnCopy(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("copy", h, scope...) return e } func (e *htmlCol) OnCut(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("cut", h, scope...) return e } func (e *htmlCol) OnDblClick(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlCol) OnDrag(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("drag", h, scope...) return e } func (e *htmlCol) OnDragEnd(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlCol) OnDragEnter(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlCol) OnDragLeave(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlCol) OnDragOver(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlCol) OnDragStart(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlCol) OnDrop(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("drop", h, scope...) return e } func (e *htmlCol) OnFocus(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("focus", h, scope...) return e } func (e *htmlCol) OnInput(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("input", h, scope...) return e } func (e *htmlCol) OnInvalid(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlCol) OnKeyDown(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlCol) OnKeyPress(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlCol) OnKeyUp(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlCol) OnMouseDown(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlCol) OnMouseMove(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlCol) OnMouseOut(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlCol) OnMouseOver(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlCol) OnMouseUp(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlCol) OnPaste(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("paste", h, scope...) return e } func (e *htmlCol) OnReset(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("reset", h, scope...) return e } func (e *htmlCol) OnScroll(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlCol) OnSearch(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("search", h, scope...) return e } func (e *htmlCol) OnSelect(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("select", h, scope...) return e } func (e *htmlCol) OnSubmit(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("submit", h, scope...) return e } func (e *htmlCol) OnWheel(h EventHandler, scope ...any) HTMLCol { e.setEventHandler("wheel", h, scope...) return e } // HTMLColGroup is the interface that describes a "colgroup" HTML element. type HTMLColGroup interface { UI // Body set the content of the element. Body(elems ...UI) HTMLColGroup // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLColGroup // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLColGroup // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLColGroup // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLColGroup // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLColGroup // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLColGroup // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLColGroup // Dir specifies the text direction for the content in an element. Dir(v string) HTMLColGroup // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLColGroup // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLColGroup // ID specifies a unique id for an element. ID(v string) HTMLColGroup // Lang specifies the language of the element's content. Lang(v string) HTMLColGroup // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLColGroup // Span specifies the number of columns to span. Span(v int) HTMLColGroup // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLColGroup // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLColGroup // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLColGroup // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLColGroup // Title specifies extra information about an element. Title(v string) HTMLColGroup // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLColGroup // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLColGroup // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLColGroup // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLColGroup // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLColGroup // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLColGroup // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLColGroup // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLColGroup // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLColGroup // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLColGroup // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLColGroup // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLColGroup // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLColGroup // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLColGroup // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLColGroup // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLColGroup // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLColGroup // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLColGroup // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLColGroup // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLColGroup // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLColGroup // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLColGroup // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLColGroup // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLColGroup // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLColGroup // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLColGroup // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLColGroup // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLColGroup // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLColGroup // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLColGroup // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLColGroup // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLColGroup // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLColGroup } // ColGroup returns an HTML element that specifies a group of one or more columns in a table for formatting. func ColGroup() HTMLColGroup { e := &htmlColGroup{ htmlElement: htmlElement{ tag: "colgroup", isSelfClosing: false, }, } return e } type htmlColGroup struct { htmlElement } func (e *htmlColGroup) Body(v ...UI) HTMLColGroup { e.setChildren(v...) return e } func (e *htmlColGroup) Text(v any) HTMLColGroup { return e.Body(Text(v)) } func (e *htmlColGroup) AccessKey(v string) HTMLColGroup { e.setAttr("accesskey", v) return e } func (e *htmlColGroup) Aria(k string, v any) HTMLColGroup { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlColGroup) Attr(n string, v any) HTMLColGroup { e.setAttr(n, v) return e } func (e *htmlColGroup) Class(v ...string) HTMLColGroup { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlColGroup) ContentEditable(v bool) HTMLColGroup { e.setAttr("contenteditable", v) return e } func (e *htmlColGroup) DataSet(k string, v any) HTMLColGroup { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlColGroup) Dir(v string) HTMLColGroup { e.setAttr("dir", v) return e } func (e *htmlColGroup) Draggable(v bool) HTMLColGroup { e.setAttr("draggable", v) return e } func (e *htmlColGroup) Hidden(v bool) HTMLColGroup { e.setAttr("hidden", v) return e } func (e *htmlColGroup) ID(v string) HTMLColGroup { e.setAttr("id", v) return e } func (e *htmlColGroup) Lang(v string) HTMLColGroup { e.setAttr("lang", v) return e } func (e *htmlColGroup) Role(v string) HTMLColGroup { e.setAttr("role", v) return e } func (e *htmlColGroup) Span(v int) HTMLColGroup { e.setAttr("span", v) return e } func (e *htmlColGroup) Spellcheck(v bool) HTMLColGroup { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlColGroup) Style(k, v string) HTMLColGroup { e.setAttr("style", k+":"+v) return e } func (e *htmlColGroup) Styles(s map[string]string) HTMLColGroup { for k, v := range s { e.Style(k, v) } return e } func (e *htmlColGroup) TabIndex(v int) HTMLColGroup { e.setAttr("tabindex", v) return e } func (e *htmlColGroup) Title(v string) HTMLColGroup { e.setAttr("title", v) return e } func (e *htmlColGroup) On(event string, h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler(event, h, scope...) return e } func (e *htmlColGroup) OnBlur(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("blur", h, scope...) return e } func (e *htmlColGroup) OnChange(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("change", h, scope...) return e } func (e *htmlColGroup) OnClick(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("click", h, scope...) return e } func (e *htmlColGroup) OnContextMenu(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlColGroup) OnCopy(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("copy", h, scope...) return e } func (e *htmlColGroup) OnCut(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("cut", h, scope...) return e } func (e *htmlColGroup) OnDblClick(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlColGroup) OnDrag(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("drag", h, scope...) return e } func (e *htmlColGroup) OnDragEnd(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlColGroup) OnDragEnter(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlColGroup) OnDragLeave(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlColGroup) OnDragOver(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlColGroup) OnDragStart(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlColGroup) OnDrop(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("drop", h, scope...) return e } func (e *htmlColGroup) OnFocus(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("focus", h, scope...) return e } func (e *htmlColGroup) OnInput(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("input", h, scope...) return e } func (e *htmlColGroup) OnInvalid(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlColGroup) OnKeyDown(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlColGroup) OnKeyPress(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlColGroup) OnKeyUp(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlColGroup) OnMouseDown(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlColGroup) OnMouseMove(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlColGroup) OnMouseOut(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlColGroup) OnMouseOver(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlColGroup) OnMouseUp(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlColGroup) OnPaste(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("paste", h, scope...) return e } func (e *htmlColGroup) OnReset(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("reset", h, scope...) return e } func (e *htmlColGroup) OnScroll(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlColGroup) OnSearch(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("search", h, scope...) return e } func (e *htmlColGroup) OnSelect(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("select", h, scope...) return e } func (e *htmlColGroup) OnSubmit(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("submit", h, scope...) return e } func (e *htmlColGroup) OnWheel(h EventHandler, scope ...any) HTMLColGroup { e.setEventHandler("wheel", h, scope...) return e } // HTMLData is the interface that describes a "data" HTML element. type HTMLData interface { UI // Body set the content of the element. Body(elems ...UI) HTMLData // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLData // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLData // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLData // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLData // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLData // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLData // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLData // Dir specifies the text direction for the content in an element. Dir(v string) HTMLData // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLData // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLData // ID specifies a unique id for an element. ID(v string) HTMLData // Lang specifies the language of the element's content. Lang(v string) HTMLData // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLData // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLData // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLData // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLData // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLData // Title specifies extra information about an element. Title(v string) HTMLData // Value specifies the value of the element. Value(v any) HTMLData // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLData } // Data returns an HTML element that links the given content with a machine-readable translation. func Data() HTMLData { e := &htmlData{ htmlElement: htmlElement{ tag: "data", isSelfClosing: false, }, } return e } type htmlData struct { htmlElement } func (e *htmlData) Body(v ...UI) HTMLData { e.setChildren(v...) return e } func (e *htmlData) Text(v any) HTMLData { return e.Body(Text(v)) } func (e *htmlData) AccessKey(v string) HTMLData { e.setAttr("accesskey", v) return e } func (e *htmlData) Aria(k string, v any) HTMLData { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlData) Attr(n string, v any) HTMLData { e.setAttr(n, v) return e } func (e *htmlData) Class(v ...string) HTMLData { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlData) ContentEditable(v bool) HTMLData { e.setAttr("contenteditable", v) return e } func (e *htmlData) DataSet(k string, v any) HTMLData { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlData) Dir(v string) HTMLData { e.setAttr("dir", v) return e } func (e *htmlData) Draggable(v bool) HTMLData { e.setAttr("draggable", v) return e } func (e *htmlData) Hidden(v bool) HTMLData { e.setAttr("hidden", v) return e } func (e *htmlData) ID(v string) HTMLData { e.setAttr("id", v) return e } func (e *htmlData) Lang(v string) HTMLData { e.setAttr("lang", v) return e } func (e *htmlData) Role(v string) HTMLData { e.setAttr("role", v) return e } func (e *htmlData) Spellcheck(v bool) HTMLData { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlData) Style(k, v string) HTMLData { e.setAttr("style", k+":"+v) return e } func (e *htmlData) Styles(s map[string]string) HTMLData { for k, v := range s { e.Style(k, v) } return e } func (e *htmlData) TabIndex(v int) HTMLData { e.setAttr("tabindex", v) return e } func (e *htmlData) Title(v string) HTMLData { e.setAttr("title", v) return e } func (e *htmlData) Value(v any) HTMLData { e.setAttr("value", v) return e } func (e *htmlData) On(event string, h EventHandler, scope ...any) HTMLData { e.setEventHandler(event, h, scope...) return e } // HTMLDataList is the interface that describes a "datalist" HTML element. type HTMLDataList interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDataList // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDataList // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDataList // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDataList // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDataList // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDataList // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDataList // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDataList // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDataList // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDataList // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDataList // ID specifies a unique id for an element. ID(v string) HTMLDataList // Lang specifies the language of the element's content. Lang(v string) HTMLDataList // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDataList // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDataList // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDataList // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDataList // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDataList // Title specifies extra information about an element. Title(v string) HTMLDataList // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDataList // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDataList // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDataList // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDataList // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDataList // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDataList // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDataList // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDataList // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDataList // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDataList // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDataList // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDataList // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDataList // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDataList // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDataList // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDataList // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDataList // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDataList // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDataList // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDataList // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDataList // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDataList // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDataList // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDataList // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDataList // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDataList // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDataList // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDataList // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDataList // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDataList // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDataList // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDataList // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDataList } // DataList returns an HTML element that specifies a list of pre-defined options for input controls. func DataList() HTMLDataList { e := &htmlDataList{ htmlElement: htmlElement{ tag: "datalist", isSelfClosing: false, }, } return e } type htmlDataList struct { htmlElement } func (e *htmlDataList) Body(v ...UI) HTMLDataList { e.setChildren(v...) return e } func (e *htmlDataList) Text(v any) HTMLDataList { return e.Body(Text(v)) } func (e *htmlDataList) AccessKey(v string) HTMLDataList { e.setAttr("accesskey", v) return e } func (e *htmlDataList) Aria(k string, v any) HTMLDataList { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDataList) Attr(n string, v any) HTMLDataList { e.setAttr(n, v) return e } func (e *htmlDataList) Class(v ...string) HTMLDataList { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDataList) ContentEditable(v bool) HTMLDataList { e.setAttr("contenteditable", v) return e } func (e *htmlDataList) DataSet(k string, v any) HTMLDataList { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDataList) Dir(v string) HTMLDataList { e.setAttr("dir", v) return e } func (e *htmlDataList) Draggable(v bool) HTMLDataList { e.setAttr("draggable", v) return e } func (e *htmlDataList) Hidden(v bool) HTMLDataList { e.setAttr("hidden", v) return e } func (e *htmlDataList) ID(v string) HTMLDataList { e.setAttr("id", v) return e } func (e *htmlDataList) Lang(v string) HTMLDataList { e.setAttr("lang", v) return e } func (e *htmlDataList) Role(v string) HTMLDataList { e.setAttr("role", v) return e } func (e *htmlDataList) Spellcheck(v bool) HTMLDataList { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDataList) Style(k, v string) HTMLDataList { e.setAttr("style", k+":"+v) return e } func (e *htmlDataList) Styles(s map[string]string) HTMLDataList { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDataList) TabIndex(v int) HTMLDataList { e.setAttr("tabindex", v) return e } func (e *htmlDataList) Title(v string) HTMLDataList { e.setAttr("title", v) return e } func (e *htmlDataList) On(event string, h EventHandler, scope ...any) HTMLDataList { e.setEventHandler(event, h, scope...) return e } func (e *htmlDataList) OnBlur(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDataList) OnChange(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("change", h, scope...) return e } func (e *htmlDataList) OnClick(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("click", h, scope...) return e } func (e *htmlDataList) OnContextMenu(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDataList) OnCopy(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDataList) OnCut(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDataList) OnDblClick(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDataList) OnDrag(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDataList) OnDragEnd(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDataList) OnDragEnter(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDataList) OnDragLeave(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDataList) OnDragOver(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDataList) OnDragStart(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDataList) OnDrop(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDataList) OnFocus(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDataList) OnInput(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("input", h, scope...) return e } func (e *htmlDataList) OnInvalid(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDataList) OnKeyDown(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDataList) OnKeyPress(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDataList) OnKeyUp(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDataList) OnMouseDown(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDataList) OnMouseMove(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDataList) OnMouseOut(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDataList) OnMouseOver(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDataList) OnMouseUp(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDataList) OnPaste(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDataList) OnReset(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDataList) OnScroll(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDataList) OnSearch(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("search", h, scope...) return e } func (e *htmlDataList) OnSelect(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("select", h, scope...) return e } func (e *htmlDataList) OnSubmit(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDataList) OnWheel(h EventHandler, scope ...any) HTMLDataList { e.setEventHandler("wheel", h, scope...) return e } // HTMLDd is the interface that describes a "dd" HTML element. type HTMLDd interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDd // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDd // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDd // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDd // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDd // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDd // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDd // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDd // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDd // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDd // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDd // ID specifies a unique id for an element. ID(v string) HTMLDd // Lang specifies the language of the element's content. Lang(v string) HTMLDd // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDd // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDd // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDd // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDd // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDd // Title specifies extra information about an element. Title(v string) HTMLDd // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDd // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDd // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDd // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDd // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDd // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDd // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDd // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDd // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDd // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDd // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDd // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDd // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDd // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDd // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDd // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDd // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDd // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDd // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDd // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDd // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDd // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDd // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDd // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDd // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDd // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDd // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDd // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDd // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDd // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDd // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDd // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDd // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDd } // Dd returns an HTML element that defines a description/value of a term in a description list. func Dd() HTMLDd { e := &htmlDd{ htmlElement: htmlElement{ tag: "dd", isSelfClosing: false, }, } return e } type htmlDd struct { htmlElement } func (e *htmlDd) Body(v ...UI) HTMLDd { e.setChildren(v...) return e } func (e *htmlDd) Text(v any) HTMLDd { return e.Body(Text(v)) } func (e *htmlDd) AccessKey(v string) HTMLDd { e.setAttr("accesskey", v) return e } func (e *htmlDd) Aria(k string, v any) HTMLDd { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDd) Attr(n string, v any) HTMLDd { e.setAttr(n, v) return e } func (e *htmlDd) Class(v ...string) HTMLDd { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDd) ContentEditable(v bool) HTMLDd { e.setAttr("contenteditable", v) return e } func (e *htmlDd) DataSet(k string, v any) HTMLDd { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDd) Dir(v string) HTMLDd { e.setAttr("dir", v) return e } func (e *htmlDd) Draggable(v bool) HTMLDd { e.setAttr("draggable", v) return e } func (e *htmlDd) Hidden(v bool) HTMLDd { e.setAttr("hidden", v) return e } func (e *htmlDd) ID(v string) HTMLDd { e.setAttr("id", v) return e } func (e *htmlDd) Lang(v string) HTMLDd { e.setAttr("lang", v) return e } func (e *htmlDd) Role(v string) HTMLDd { e.setAttr("role", v) return e } func (e *htmlDd) Spellcheck(v bool) HTMLDd { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDd) Style(k, v string) HTMLDd { e.setAttr("style", k+":"+v) return e } func (e *htmlDd) Styles(s map[string]string) HTMLDd { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDd) TabIndex(v int) HTMLDd { e.setAttr("tabindex", v) return e } func (e *htmlDd) Title(v string) HTMLDd { e.setAttr("title", v) return e } func (e *htmlDd) On(event string, h EventHandler, scope ...any) HTMLDd { e.setEventHandler(event, h, scope...) return e } func (e *htmlDd) OnBlur(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDd) OnChange(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("change", h, scope...) return e } func (e *htmlDd) OnClick(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("click", h, scope...) return e } func (e *htmlDd) OnContextMenu(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDd) OnCopy(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDd) OnCut(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDd) OnDblClick(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDd) OnDrag(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDd) OnDragEnd(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDd) OnDragEnter(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDd) OnDragLeave(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDd) OnDragOver(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDd) OnDragStart(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDd) OnDrop(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDd) OnFocus(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDd) OnInput(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("input", h, scope...) return e } func (e *htmlDd) OnInvalid(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDd) OnKeyDown(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDd) OnKeyPress(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDd) OnKeyUp(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDd) OnMouseDown(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDd) OnMouseMove(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDd) OnMouseOut(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDd) OnMouseOver(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDd) OnMouseUp(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDd) OnPaste(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDd) OnReset(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDd) OnScroll(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDd) OnSearch(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("search", h, scope...) return e } func (e *htmlDd) OnSelect(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("select", h, scope...) return e } func (e *htmlDd) OnSubmit(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDd) OnWheel(h EventHandler, scope ...any) HTMLDd { e.setEventHandler("wheel", h, scope...) return e } // HTMLDel is the interface that describes a "del" HTML element. type HTMLDel interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDel // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDel // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDel // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDel // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDel // Cite specifies a URL which explains the quote/deleted/inserted text. Cite(v string) HTMLDel // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDel // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDel // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDel // DateTime specifies the date and time. DateTime(v string) HTMLDel // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDel // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDel // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDel // ID specifies a unique id for an element. ID(v string) HTMLDel // Lang specifies the language of the element's content. Lang(v string) HTMLDel // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDel // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDel // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDel // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDel // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDel // Title specifies extra information about an element. Title(v string) HTMLDel // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDel // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDel // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDel // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDel // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDel // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDel // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDel // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDel // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDel // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDel // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDel // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDel // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDel // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDel // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDel // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDel // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDel // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDel // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDel // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDel // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDel // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDel // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDel // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDel // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDel // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDel // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDel // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDel // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDel // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDel // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDel // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDel // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDel } // Del returns an HTML element that defines text that has been deleted from a document. func Del() HTMLDel { e := &htmlDel{ htmlElement: htmlElement{ tag: "del", isSelfClosing: false, }, } return e } type htmlDel struct { htmlElement } func (e *htmlDel) Body(v ...UI) HTMLDel { e.setChildren(v...) return e } func (e *htmlDel) Text(v any) HTMLDel { return e.Body(Text(v)) } func (e *htmlDel) AccessKey(v string) HTMLDel { e.setAttr("accesskey", v) return e } func (e *htmlDel) Aria(k string, v any) HTMLDel { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDel) Attr(n string, v any) HTMLDel { e.setAttr(n, v) return e } func (e *htmlDel) Cite(v string) HTMLDel { e.setAttr("cite", v) return e } func (e *htmlDel) Class(v ...string) HTMLDel { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDel) ContentEditable(v bool) HTMLDel { e.setAttr("contenteditable", v) return e } func (e *htmlDel) DataSet(k string, v any) HTMLDel { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDel) DateTime(v string) HTMLDel { e.setAttr("datetime", v) return e } func (e *htmlDel) Dir(v string) HTMLDel { e.setAttr("dir", v) return e } func (e *htmlDel) Draggable(v bool) HTMLDel { e.setAttr("draggable", v) return e } func (e *htmlDel) Hidden(v bool) HTMLDel { e.setAttr("hidden", v) return e } func (e *htmlDel) ID(v string) HTMLDel { e.setAttr("id", v) return e } func (e *htmlDel) Lang(v string) HTMLDel { e.setAttr("lang", v) return e } func (e *htmlDel) Role(v string) HTMLDel { e.setAttr("role", v) return e } func (e *htmlDel) Spellcheck(v bool) HTMLDel { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDel) Style(k, v string) HTMLDel { e.setAttr("style", k+":"+v) return e } func (e *htmlDel) Styles(s map[string]string) HTMLDel { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDel) TabIndex(v int) HTMLDel { e.setAttr("tabindex", v) return e } func (e *htmlDel) Title(v string) HTMLDel { e.setAttr("title", v) return e } func (e *htmlDel) On(event string, h EventHandler, scope ...any) HTMLDel { e.setEventHandler(event, h, scope...) return e } func (e *htmlDel) OnBlur(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDel) OnChange(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("change", h, scope...) return e } func (e *htmlDel) OnClick(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("click", h, scope...) return e } func (e *htmlDel) OnContextMenu(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDel) OnCopy(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDel) OnCut(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDel) OnDblClick(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDel) OnDrag(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDel) OnDragEnd(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDel) OnDragEnter(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDel) OnDragLeave(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDel) OnDragOver(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDel) OnDragStart(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDel) OnDrop(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDel) OnFocus(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDel) OnInput(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("input", h, scope...) return e } func (e *htmlDel) OnInvalid(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDel) OnKeyDown(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDel) OnKeyPress(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDel) OnKeyUp(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDel) OnMouseDown(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDel) OnMouseMove(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDel) OnMouseOut(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDel) OnMouseOver(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDel) OnMouseUp(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDel) OnPaste(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDel) OnReset(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDel) OnScroll(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDel) OnSearch(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("search", h, scope...) return e } func (e *htmlDel) OnSelect(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("select", h, scope...) return e } func (e *htmlDel) OnSubmit(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDel) OnWheel(h EventHandler, scope ...any) HTMLDel { e.setEventHandler("wheel", h, scope...) return e } // HTMLDetails is the interface that describes a "details" HTML element. type HTMLDetails interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDetails // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDetails // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDetails // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDetails // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDetails // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDetails // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDetails // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDetails // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDetails // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDetails // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDetails // ID specifies a unique id for an element. ID(v string) HTMLDetails // Lang specifies the language of the element's content. Lang(v string) HTMLDetails // Open specifies that the details should be visible (open) to the user. Open(v bool) HTMLDetails // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDetails // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDetails // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDetails // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDetails // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDetails // Title specifies extra information about an element. Title(v string) HTMLDetails // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDetails // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDetails // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDetails // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDetails // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDetails // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDetails // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDetails // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDetails // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDetails // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDetails // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDetails // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDetails // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDetails // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDetails // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDetails // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDetails // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDetails // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDetails // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDetails // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDetails // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDetails // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDetails // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDetails // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDetails // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDetails // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDetails // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDetails // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDetails // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDetails // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDetails // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDetails // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDetails // OnToggle calls the given handler when the user opens or closes the details element. OnToggle(h EventHandler, scope ...any) HTMLDetails // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDetails } // Details returns an HTML element that defines additional details that the user can view or hide. func Details() HTMLDetails { e := &htmlDetails{ htmlElement: htmlElement{ tag: "details", isSelfClosing: false, }, } return e } type htmlDetails struct { htmlElement } func (e *htmlDetails) Body(v ...UI) HTMLDetails { e.setChildren(v...) return e } func (e *htmlDetails) Text(v any) HTMLDetails { return e.Body(Text(v)) } func (e *htmlDetails) AccessKey(v string) HTMLDetails { e.setAttr("accesskey", v) return e } func (e *htmlDetails) Aria(k string, v any) HTMLDetails { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDetails) Attr(n string, v any) HTMLDetails { e.setAttr(n, v) return e } func (e *htmlDetails) Class(v ...string) HTMLDetails { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDetails) ContentEditable(v bool) HTMLDetails { e.setAttr("contenteditable", v) return e } func (e *htmlDetails) DataSet(k string, v any) HTMLDetails { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDetails) Dir(v string) HTMLDetails { e.setAttr("dir", v) return e } func (e *htmlDetails) Draggable(v bool) HTMLDetails { e.setAttr("draggable", v) return e } func (e *htmlDetails) Hidden(v bool) HTMLDetails { e.setAttr("hidden", v) return e } func (e *htmlDetails) ID(v string) HTMLDetails { e.setAttr("id", v) return e } func (e *htmlDetails) Lang(v string) HTMLDetails { e.setAttr("lang", v) return e } func (e *htmlDetails) Open(v bool) HTMLDetails { e.setAttr("open", v) return e } func (e *htmlDetails) Role(v string) HTMLDetails { e.setAttr("role", v) return e } func (e *htmlDetails) Spellcheck(v bool) HTMLDetails { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDetails) Style(k, v string) HTMLDetails { e.setAttr("style", k+":"+v) return e } func (e *htmlDetails) Styles(s map[string]string) HTMLDetails { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDetails) TabIndex(v int) HTMLDetails { e.setAttr("tabindex", v) return e } func (e *htmlDetails) Title(v string) HTMLDetails { e.setAttr("title", v) return e } func (e *htmlDetails) On(event string, h EventHandler, scope ...any) HTMLDetails { e.setEventHandler(event, h, scope...) return e } func (e *htmlDetails) OnBlur(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDetails) OnChange(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("change", h, scope...) return e } func (e *htmlDetails) OnClick(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("click", h, scope...) return e } func (e *htmlDetails) OnContextMenu(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDetails) OnCopy(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDetails) OnCut(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDetails) OnDblClick(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDetails) OnDrag(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDetails) OnDragEnd(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDetails) OnDragEnter(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDetails) OnDragLeave(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDetails) OnDragOver(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDetails) OnDragStart(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDetails) OnDrop(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDetails) OnFocus(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDetails) OnInput(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("input", h, scope...) return e } func (e *htmlDetails) OnInvalid(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDetails) OnKeyDown(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDetails) OnKeyPress(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDetails) OnKeyUp(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDetails) OnMouseDown(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDetails) OnMouseMove(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDetails) OnMouseOut(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDetails) OnMouseOver(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDetails) OnMouseUp(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDetails) OnPaste(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDetails) OnReset(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDetails) OnScroll(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDetails) OnSearch(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("search", h, scope...) return e } func (e *htmlDetails) OnSelect(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("select", h, scope...) return e } func (e *htmlDetails) OnSubmit(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDetails) OnToggle(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("toggle", h, scope...) return e } func (e *htmlDetails) OnWheel(h EventHandler, scope ...any) HTMLDetails { e.setEventHandler("wheel", h, scope...) return e } // HTMLDfn is the interface that describes a "dfn" HTML element. type HTMLDfn interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDfn // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDfn // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDfn // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDfn // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDfn // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDfn // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDfn // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDfn // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDfn // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDfn // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDfn // ID specifies a unique id for an element. ID(v string) HTMLDfn // Lang specifies the language of the element's content. Lang(v string) HTMLDfn // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDfn // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDfn // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDfn // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDfn // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDfn // Title specifies extra information about an element. Title(v string) HTMLDfn // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDfn // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDfn // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDfn // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDfn // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDfn // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDfn // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDfn // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDfn // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDfn // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDfn // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDfn // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDfn // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDfn // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDfn // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDfn // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDfn // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDfn // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDfn // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDfn // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDfn // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDfn // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDfn // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDfn // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDfn // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDfn // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDfn // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDfn // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDfn // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDfn // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDfn // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDfn // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDfn // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDfn } // Dfn returns an HTML element that represents the defining instance of a term. func Dfn() HTMLDfn { e := &htmlDfn{ htmlElement: htmlElement{ tag: "dfn", isSelfClosing: false, }, } return e } type htmlDfn struct { htmlElement } func (e *htmlDfn) Body(v ...UI) HTMLDfn { e.setChildren(v...) return e } func (e *htmlDfn) Text(v any) HTMLDfn { return e.Body(Text(v)) } func (e *htmlDfn) AccessKey(v string) HTMLDfn { e.setAttr("accesskey", v) return e } func (e *htmlDfn) Aria(k string, v any) HTMLDfn { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDfn) Attr(n string, v any) HTMLDfn { e.setAttr(n, v) return e } func (e *htmlDfn) Class(v ...string) HTMLDfn { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDfn) ContentEditable(v bool) HTMLDfn { e.setAttr("contenteditable", v) return e } func (e *htmlDfn) DataSet(k string, v any) HTMLDfn { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDfn) Dir(v string) HTMLDfn { e.setAttr("dir", v) return e } func (e *htmlDfn) Draggable(v bool) HTMLDfn { e.setAttr("draggable", v) return e } func (e *htmlDfn) Hidden(v bool) HTMLDfn { e.setAttr("hidden", v) return e } func (e *htmlDfn) ID(v string) HTMLDfn { e.setAttr("id", v) return e } func (e *htmlDfn) Lang(v string) HTMLDfn { e.setAttr("lang", v) return e } func (e *htmlDfn) Role(v string) HTMLDfn { e.setAttr("role", v) return e } func (e *htmlDfn) Spellcheck(v bool) HTMLDfn { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDfn) Style(k, v string) HTMLDfn { e.setAttr("style", k+":"+v) return e } func (e *htmlDfn) Styles(s map[string]string) HTMLDfn { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDfn) TabIndex(v int) HTMLDfn { e.setAttr("tabindex", v) return e } func (e *htmlDfn) Title(v string) HTMLDfn { e.setAttr("title", v) return e } func (e *htmlDfn) On(event string, h EventHandler, scope ...any) HTMLDfn { e.setEventHandler(event, h, scope...) return e } func (e *htmlDfn) OnBlur(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDfn) OnChange(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("change", h, scope...) return e } func (e *htmlDfn) OnClick(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("click", h, scope...) return e } func (e *htmlDfn) OnContextMenu(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDfn) OnCopy(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDfn) OnCut(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDfn) OnDblClick(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDfn) OnDrag(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDfn) OnDragEnd(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDfn) OnDragEnter(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDfn) OnDragLeave(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDfn) OnDragOver(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDfn) OnDragStart(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDfn) OnDrop(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDfn) OnFocus(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDfn) OnInput(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("input", h, scope...) return e } func (e *htmlDfn) OnInvalid(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDfn) OnKeyDown(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDfn) OnKeyPress(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDfn) OnKeyUp(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDfn) OnMouseDown(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDfn) OnMouseMove(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDfn) OnMouseOut(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDfn) OnMouseOver(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDfn) OnMouseUp(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDfn) OnPaste(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDfn) OnReset(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDfn) OnScroll(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDfn) OnSearch(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("search", h, scope...) return e } func (e *htmlDfn) OnSelect(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("select", h, scope...) return e } func (e *htmlDfn) OnSubmit(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDfn) OnWheel(h EventHandler, scope ...any) HTMLDfn { e.setEventHandler("wheel", h, scope...) return e } // HTMLDialog is the interface that describes a "dialog" HTML element. type HTMLDialog interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDialog // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDialog // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDialog // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDialog // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDialog // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDialog // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDialog // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDialog // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDialog // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDialog // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDialog // ID specifies a unique id for an element. ID(v string) HTMLDialog // Lang specifies the language of the element's content. Lang(v string) HTMLDialog // Open specifies that the details should be visible (open) to the user. Open(v bool) HTMLDialog // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDialog // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDialog // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDialog // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDialog // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDialog // Title specifies extra information about an element. Title(v string) HTMLDialog // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDialog // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDialog // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDialog // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDialog // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDialog // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDialog // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDialog // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDialog // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDialog // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDialog // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDialog // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDialog // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDialog // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDialog // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDialog // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDialog // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDialog // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDialog // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDialog // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDialog // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDialog // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDialog // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDialog // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDialog // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDialog // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDialog // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDialog // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDialog // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDialog // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDialog // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDialog // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDialog // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDialog } // Dialog returns an HTML element that defines a dialog box or window. func Dialog() HTMLDialog { e := &htmlDialog{ htmlElement: htmlElement{ tag: "dialog", isSelfClosing: false, }, } return e } type htmlDialog struct { htmlElement } func (e *htmlDialog) Body(v ...UI) HTMLDialog { e.setChildren(v...) return e } func (e *htmlDialog) Text(v any) HTMLDialog { return e.Body(Text(v)) } func (e *htmlDialog) AccessKey(v string) HTMLDialog { e.setAttr("accesskey", v) return e } func (e *htmlDialog) Aria(k string, v any) HTMLDialog { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDialog) Attr(n string, v any) HTMLDialog { e.setAttr(n, v) return e } func (e *htmlDialog) Class(v ...string) HTMLDialog { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDialog) ContentEditable(v bool) HTMLDialog { e.setAttr("contenteditable", v) return e } func (e *htmlDialog) DataSet(k string, v any) HTMLDialog { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDialog) Dir(v string) HTMLDialog { e.setAttr("dir", v) return e } func (e *htmlDialog) Draggable(v bool) HTMLDialog { e.setAttr("draggable", v) return e } func (e *htmlDialog) Hidden(v bool) HTMLDialog { e.setAttr("hidden", v) return e } func (e *htmlDialog) ID(v string) HTMLDialog { e.setAttr("id", v) return e } func (e *htmlDialog) Lang(v string) HTMLDialog { e.setAttr("lang", v) return e } func (e *htmlDialog) Open(v bool) HTMLDialog { e.setAttr("open", v) return e } func (e *htmlDialog) Role(v string) HTMLDialog { e.setAttr("role", v) return e } func (e *htmlDialog) Spellcheck(v bool) HTMLDialog { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDialog) Style(k, v string) HTMLDialog { e.setAttr("style", k+":"+v) return e } func (e *htmlDialog) Styles(s map[string]string) HTMLDialog { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDialog) TabIndex(v int) HTMLDialog { e.setAttr("tabindex", v) return e } func (e *htmlDialog) Title(v string) HTMLDialog { e.setAttr("title", v) return e } func (e *htmlDialog) On(event string, h EventHandler, scope ...any) HTMLDialog { e.setEventHandler(event, h, scope...) return e } func (e *htmlDialog) OnBlur(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDialog) OnChange(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("change", h, scope...) return e } func (e *htmlDialog) OnClick(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("click", h, scope...) return e } func (e *htmlDialog) OnContextMenu(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDialog) OnCopy(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDialog) OnCut(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDialog) OnDblClick(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDialog) OnDrag(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDialog) OnDragEnd(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDialog) OnDragEnter(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDialog) OnDragLeave(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDialog) OnDragOver(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDialog) OnDragStart(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDialog) OnDrop(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDialog) OnFocus(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDialog) OnInput(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("input", h, scope...) return e } func (e *htmlDialog) OnInvalid(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDialog) OnKeyDown(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDialog) OnKeyPress(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDialog) OnKeyUp(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDialog) OnMouseDown(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDialog) OnMouseMove(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDialog) OnMouseOut(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDialog) OnMouseOver(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDialog) OnMouseUp(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDialog) OnPaste(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDialog) OnReset(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDialog) OnScroll(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDialog) OnSearch(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("search", h, scope...) return e } func (e *htmlDialog) OnSelect(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("select", h, scope...) return e } func (e *htmlDialog) OnSubmit(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDialog) OnWheel(h EventHandler, scope ...any) HTMLDialog { e.setEventHandler("wheel", h, scope...) return e } // HTMLDiv is the interface that describes a "div" HTML element. type HTMLDiv interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDiv // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDiv // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDiv // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDiv // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDiv // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDiv // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDiv // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDiv // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDiv // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDiv // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDiv // ID specifies a unique id for an element. ID(v string) HTMLDiv // Lang specifies the language of the element's content. Lang(v string) HTMLDiv // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDiv // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDiv // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDiv // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDiv // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDiv // Title specifies extra information about an element. Title(v string) HTMLDiv // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDiv // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDiv // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDiv // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDiv // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDiv // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDiv // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDiv // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDiv // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDiv // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDiv // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDiv // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDiv // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDiv // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDiv // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDiv // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDiv // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDiv // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDiv // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDiv // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDiv // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDiv // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDiv // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDiv // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDiv // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDiv // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDiv // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDiv // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDiv // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDiv // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDiv // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDiv // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDiv // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDiv } // Div returns an HTML element that defines a section in a document. func Div() HTMLDiv { e := &htmlDiv{ htmlElement: htmlElement{ tag: "div", isSelfClosing: false, }, } return e } type htmlDiv struct { htmlElement } func (e *htmlDiv) Body(v ...UI) HTMLDiv { e.setChildren(v...) return e } func (e *htmlDiv) Text(v any) HTMLDiv { return e.Body(Text(v)) } func (e *htmlDiv) AccessKey(v string) HTMLDiv { e.setAttr("accesskey", v) return e } func (e *htmlDiv) Aria(k string, v any) HTMLDiv { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDiv) Attr(n string, v any) HTMLDiv { e.setAttr(n, v) return e } func (e *htmlDiv) Class(v ...string) HTMLDiv { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDiv) ContentEditable(v bool) HTMLDiv { e.setAttr("contenteditable", v) return e } func (e *htmlDiv) DataSet(k string, v any) HTMLDiv { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDiv) Dir(v string) HTMLDiv { e.setAttr("dir", v) return e } func (e *htmlDiv) Draggable(v bool) HTMLDiv { e.setAttr("draggable", v) return e } func (e *htmlDiv) Hidden(v bool) HTMLDiv { e.setAttr("hidden", v) return e } func (e *htmlDiv) ID(v string) HTMLDiv { e.setAttr("id", v) return e } func (e *htmlDiv) Lang(v string) HTMLDiv { e.setAttr("lang", v) return e } func (e *htmlDiv) Role(v string) HTMLDiv { e.setAttr("role", v) return e } func (e *htmlDiv) Spellcheck(v bool) HTMLDiv { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDiv) Style(k, v string) HTMLDiv { e.setAttr("style", k+":"+v) return e } func (e *htmlDiv) Styles(s map[string]string) HTMLDiv { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDiv) TabIndex(v int) HTMLDiv { e.setAttr("tabindex", v) return e } func (e *htmlDiv) Title(v string) HTMLDiv { e.setAttr("title", v) return e } func (e *htmlDiv) On(event string, h EventHandler, scope ...any) HTMLDiv { e.setEventHandler(event, h, scope...) return e } func (e *htmlDiv) OnBlur(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDiv) OnChange(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("change", h, scope...) return e } func (e *htmlDiv) OnClick(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("click", h, scope...) return e } func (e *htmlDiv) OnContextMenu(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDiv) OnCopy(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDiv) OnCut(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDiv) OnDblClick(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDiv) OnDrag(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDiv) OnDragEnd(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDiv) OnDragEnter(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDiv) OnDragLeave(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDiv) OnDragOver(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDiv) OnDragStart(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDiv) OnDrop(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDiv) OnFocus(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDiv) OnInput(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("input", h, scope...) return e } func (e *htmlDiv) OnInvalid(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDiv) OnKeyDown(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDiv) OnKeyPress(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDiv) OnKeyUp(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDiv) OnMouseDown(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDiv) OnMouseMove(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDiv) OnMouseOut(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDiv) OnMouseOver(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDiv) OnMouseUp(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDiv) OnPaste(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDiv) OnReset(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDiv) OnScroll(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDiv) OnSearch(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("search", h, scope...) return e } func (e *htmlDiv) OnSelect(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("select", h, scope...) return e } func (e *htmlDiv) OnSubmit(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDiv) OnWheel(h EventHandler, scope ...any) HTMLDiv { e.setEventHandler("wheel", h, scope...) return e } // HTMLDl is the interface that describes a "dl" HTML element. type HTMLDl interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDl // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDl // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDl // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDl // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDl // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDl // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDl // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDl // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDl // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDl // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDl // ID specifies a unique id for an element. ID(v string) HTMLDl // Lang specifies the language of the element's content. Lang(v string) HTMLDl // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDl // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDl // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDl // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDl // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDl // Title specifies extra information about an element. Title(v string) HTMLDl // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDl // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDl // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDl // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDl // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDl // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDl // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDl // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDl // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDl // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDl // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDl // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDl // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDl // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDl // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDl // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDl // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDl // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDl // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDl // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDl // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDl // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDl // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDl // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDl // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDl // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDl // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDl // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDl // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDl // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDl // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDl // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDl // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDl } // Dl returns an HTML element that defines a description list. func Dl() HTMLDl { e := &htmlDl{ htmlElement: htmlElement{ tag: "dl", isSelfClosing: false, }, } return e } type htmlDl struct { htmlElement } func (e *htmlDl) Body(v ...UI) HTMLDl { e.setChildren(v...) return e } func (e *htmlDl) Text(v any) HTMLDl { return e.Body(Text(v)) } func (e *htmlDl) AccessKey(v string) HTMLDl { e.setAttr("accesskey", v) return e } func (e *htmlDl) Aria(k string, v any) HTMLDl { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDl) Attr(n string, v any) HTMLDl { e.setAttr(n, v) return e } func (e *htmlDl) Class(v ...string) HTMLDl { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDl) ContentEditable(v bool) HTMLDl { e.setAttr("contenteditable", v) return e } func (e *htmlDl) DataSet(k string, v any) HTMLDl { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDl) Dir(v string) HTMLDl { e.setAttr("dir", v) return e } func (e *htmlDl) Draggable(v bool) HTMLDl { e.setAttr("draggable", v) return e } func (e *htmlDl) Hidden(v bool) HTMLDl { e.setAttr("hidden", v) return e } func (e *htmlDl) ID(v string) HTMLDl { e.setAttr("id", v) return e } func (e *htmlDl) Lang(v string) HTMLDl { e.setAttr("lang", v) return e } func (e *htmlDl) Role(v string) HTMLDl { e.setAttr("role", v) return e } func (e *htmlDl) Spellcheck(v bool) HTMLDl { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDl) Style(k, v string) HTMLDl { e.setAttr("style", k+":"+v) return e } func (e *htmlDl) Styles(s map[string]string) HTMLDl { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDl) TabIndex(v int) HTMLDl { e.setAttr("tabindex", v) return e } func (e *htmlDl) Title(v string) HTMLDl { e.setAttr("title", v) return e } func (e *htmlDl) On(event string, h EventHandler, scope ...any) HTMLDl { e.setEventHandler(event, h, scope...) return e } func (e *htmlDl) OnBlur(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDl) OnChange(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("change", h, scope...) return e } func (e *htmlDl) OnClick(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("click", h, scope...) return e } func (e *htmlDl) OnContextMenu(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDl) OnCopy(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDl) OnCut(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDl) OnDblClick(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDl) OnDrag(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDl) OnDragEnd(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDl) OnDragEnter(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDl) OnDragLeave(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDl) OnDragOver(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDl) OnDragStart(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDl) OnDrop(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDl) OnFocus(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDl) OnInput(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("input", h, scope...) return e } func (e *htmlDl) OnInvalid(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDl) OnKeyDown(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDl) OnKeyPress(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDl) OnKeyUp(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDl) OnMouseDown(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDl) OnMouseMove(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDl) OnMouseOut(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDl) OnMouseOver(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDl) OnMouseUp(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDl) OnPaste(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDl) OnReset(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDl) OnScroll(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDl) OnSearch(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("search", h, scope...) return e } func (e *htmlDl) OnSelect(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("select", h, scope...) return e } func (e *htmlDl) OnSubmit(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDl) OnWheel(h EventHandler, scope ...any) HTMLDl { e.setEventHandler("wheel", h, scope...) return e } // HTMLDt is the interface that describes a "dt" HTML element. type HTMLDt interface { UI // Body set the content of the element. Body(elems ...UI) HTMLDt // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLDt // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLDt // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLDt // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLDt // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLDt // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLDt // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLDt // Dir specifies the text direction for the content in an element. Dir(v string) HTMLDt // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLDt // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLDt // ID specifies a unique id for an element. ID(v string) HTMLDt // Lang specifies the language of the element's content. Lang(v string) HTMLDt // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLDt // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLDt // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLDt // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLDt // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLDt // Title specifies extra information about an element. Title(v string) HTMLDt // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLDt // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLDt // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLDt // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLDt // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLDt // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLDt // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLDt // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLDt // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLDt // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLDt // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLDt // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLDt // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLDt // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLDt // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLDt // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLDt // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLDt // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLDt // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLDt // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLDt // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLDt // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLDt // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLDt // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLDt // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLDt // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLDt // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLDt // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLDt // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLDt // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLDt // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLDt // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLDt // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLDt } // Dt returns an HTML element that defines a term/name in a description list. func Dt() HTMLDt { e := &htmlDt{ htmlElement: htmlElement{ tag: "dt", isSelfClosing: false, }, } return e } type htmlDt struct { htmlElement } func (e *htmlDt) Body(v ...UI) HTMLDt { e.setChildren(v...) return e } func (e *htmlDt) Text(v any) HTMLDt { return e.Body(Text(v)) } func (e *htmlDt) AccessKey(v string) HTMLDt { e.setAttr("accesskey", v) return e } func (e *htmlDt) Aria(k string, v any) HTMLDt { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDt) Attr(n string, v any) HTMLDt { e.setAttr(n, v) return e } func (e *htmlDt) Class(v ...string) HTMLDt { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlDt) ContentEditable(v bool) HTMLDt { e.setAttr("contenteditable", v) return e } func (e *htmlDt) DataSet(k string, v any) HTMLDt { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlDt) Dir(v string) HTMLDt { e.setAttr("dir", v) return e } func (e *htmlDt) Draggable(v bool) HTMLDt { e.setAttr("draggable", v) return e } func (e *htmlDt) Hidden(v bool) HTMLDt { e.setAttr("hidden", v) return e } func (e *htmlDt) ID(v string) HTMLDt { e.setAttr("id", v) return e } func (e *htmlDt) Lang(v string) HTMLDt { e.setAttr("lang", v) return e } func (e *htmlDt) Role(v string) HTMLDt { e.setAttr("role", v) return e } func (e *htmlDt) Spellcheck(v bool) HTMLDt { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlDt) Style(k, v string) HTMLDt { e.setAttr("style", k+":"+v) return e } func (e *htmlDt) Styles(s map[string]string) HTMLDt { for k, v := range s { e.Style(k, v) } return e } func (e *htmlDt) TabIndex(v int) HTMLDt { e.setAttr("tabindex", v) return e } func (e *htmlDt) Title(v string) HTMLDt { e.setAttr("title", v) return e } func (e *htmlDt) On(event string, h EventHandler, scope ...any) HTMLDt { e.setEventHandler(event, h, scope...) return e } func (e *htmlDt) OnBlur(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("blur", h, scope...) return e } func (e *htmlDt) OnChange(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("change", h, scope...) return e } func (e *htmlDt) OnClick(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("click", h, scope...) return e } func (e *htmlDt) OnContextMenu(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlDt) OnCopy(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("copy", h, scope...) return e } func (e *htmlDt) OnCut(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("cut", h, scope...) return e } func (e *htmlDt) OnDblClick(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlDt) OnDrag(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("drag", h, scope...) return e } func (e *htmlDt) OnDragEnd(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlDt) OnDragEnter(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlDt) OnDragLeave(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlDt) OnDragOver(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlDt) OnDragStart(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlDt) OnDrop(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("drop", h, scope...) return e } func (e *htmlDt) OnFocus(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("focus", h, scope...) return e } func (e *htmlDt) OnInput(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("input", h, scope...) return e } func (e *htmlDt) OnInvalid(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlDt) OnKeyDown(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlDt) OnKeyPress(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlDt) OnKeyUp(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlDt) OnMouseDown(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlDt) OnMouseMove(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlDt) OnMouseOut(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlDt) OnMouseOver(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlDt) OnMouseUp(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlDt) OnPaste(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("paste", h, scope...) return e } func (e *htmlDt) OnReset(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("reset", h, scope...) return e } func (e *htmlDt) OnScroll(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlDt) OnSearch(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("search", h, scope...) return e } func (e *htmlDt) OnSelect(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("select", h, scope...) return e } func (e *htmlDt) OnSubmit(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("submit", h, scope...) return e } func (e *htmlDt) OnWheel(h EventHandler, scope ...any) HTMLDt { e.setEventHandler("wheel", h, scope...) return e } // HTMLElem is the interface that describes a "elem" HTML element. type HTMLElem interface { UI // Body set the content of the element. Body(elems ...UI) HTMLElem // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLElem // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLElem // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLElem // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLElem // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLElem // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLElem // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLElem // Dir specifies the text direction for the content in an element. Dir(v string) HTMLElem // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLElem // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLElem // ID specifies a unique id for an element. ID(v string) HTMLElem // Lang specifies the language of the element's content. Lang(v string) HTMLElem // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLElem // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLElem // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLElem // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLElem // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLElem // Title specifies extra information about an element. Title(v string) HTMLElem // XMLNS specifies the xml namespace of the element. XMLNS(v string) HTMLElem // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLElem // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLElem // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLElem // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLElem // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLElem // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLElem // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLElem // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLElem // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLElem // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLElem // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLElem // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLElem // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLElem // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLElem // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLElem // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLElem // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLElem // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLElem // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLElem // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLElem // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLElem // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLElem // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLElem // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLElem // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLElem // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLElem // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLElem // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLElem // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLElem // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLElem // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLElem // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLElem // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLElem } // Elem returns an HTML element that represents an customizable HTML element. func Elem(tag string) HTMLElem { e := &htmlElem{ htmlElement: htmlElement{ tag: tag, isSelfClosing: false, }, } return e } type htmlElem struct { htmlElement } func (e *htmlElem) Body(v ...UI) HTMLElem { e.setChildren(v...) return e } func (e *htmlElem) Text(v any) HTMLElem { return e.Body(Text(v)) } func (e *htmlElem) AccessKey(v string) HTMLElem { e.setAttr("accesskey", v) return e } func (e *htmlElem) Aria(k string, v any) HTMLElem { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlElem) Attr(n string, v any) HTMLElem { e.setAttr(n, v) return e } func (e *htmlElem) Class(v ...string) HTMLElem { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlElem) ContentEditable(v bool) HTMLElem { e.setAttr("contenteditable", v) return e } func (e *htmlElem) DataSet(k string, v any) HTMLElem { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlElem) Dir(v string) HTMLElem { e.setAttr("dir", v) return e } func (e *htmlElem) Draggable(v bool) HTMLElem { e.setAttr("draggable", v) return e } func (e *htmlElem) Hidden(v bool) HTMLElem { e.setAttr("hidden", v) return e } func (e *htmlElem) ID(v string) HTMLElem { e.setAttr("id", v) return e } func (e *htmlElem) Lang(v string) HTMLElem { e.setAttr("lang", v) return e } func (e *htmlElem) Role(v string) HTMLElem { e.setAttr("role", v) return e } func (e *htmlElem) Spellcheck(v bool) HTMLElem { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlElem) Style(k, v string) HTMLElem { e.setAttr("style", k+":"+v) return e } func (e *htmlElem) Styles(s map[string]string) HTMLElem { for k, v := range s { e.Style(k, v) } return e } func (e *htmlElem) TabIndex(v int) HTMLElem { e.setAttr("tabindex", v) return e } func (e *htmlElem) Title(v string) HTMLElem { e.setAttr("title", v) return e } func (e *htmlElem) XMLNS(v string) HTMLElem { e.xmlns = v return e } func (e *htmlElem) On(event string, h EventHandler, scope ...any) HTMLElem { e.setEventHandler(event, h, scope...) return e } func (e *htmlElem) OnBlur(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("blur", h, scope...) return e } func (e *htmlElem) OnChange(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("change", h, scope...) return e } func (e *htmlElem) OnClick(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("click", h, scope...) return e } func (e *htmlElem) OnContextMenu(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlElem) OnCopy(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("copy", h, scope...) return e } func (e *htmlElem) OnCut(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("cut", h, scope...) return e } func (e *htmlElem) OnDblClick(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlElem) OnDrag(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("drag", h, scope...) return e } func (e *htmlElem) OnDragEnd(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlElem) OnDragEnter(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlElem) OnDragLeave(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlElem) OnDragOver(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlElem) OnDragStart(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlElem) OnDrop(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("drop", h, scope...) return e } func (e *htmlElem) OnFocus(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("focus", h, scope...) return e } func (e *htmlElem) OnInput(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("input", h, scope...) return e } func (e *htmlElem) OnInvalid(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlElem) OnKeyDown(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlElem) OnKeyPress(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlElem) OnKeyUp(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlElem) OnMouseDown(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlElem) OnMouseMove(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlElem) OnMouseOut(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlElem) OnMouseOver(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlElem) OnMouseUp(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlElem) OnPaste(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("paste", h, scope...) return e } func (e *htmlElem) OnReset(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("reset", h, scope...) return e } func (e *htmlElem) OnScroll(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlElem) OnSearch(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("search", h, scope...) return e } func (e *htmlElem) OnSelect(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("select", h, scope...) return e } func (e *htmlElem) OnSubmit(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("submit", h, scope...) return e } func (e *htmlElem) OnWheel(h EventHandler, scope ...any) HTMLElem { e.setEventHandler("wheel", h, scope...) return e } // HTMLElemSelfClosing is the interface that describes a "elemselfclosing" HTML element. type HTMLElemSelfClosing interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLElemSelfClosing // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLElemSelfClosing // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLElemSelfClosing // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLElemSelfClosing // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLElemSelfClosing // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLElemSelfClosing // Dir specifies the text direction for the content in an element. Dir(v string) HTMLElemSelfClosing // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLElemSelfClosing // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLElemSelfClosing // ID specifies a unique id for an element. ID(v string) HTMLElemSelfClosing // Lang specifies the language of the element's content. Lang(v string) HTMLElemSelfClosing // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLElemSelfClosing // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLElemSelfClosing // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLElemSelfClosing // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLElemSelfClosing // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLElemSelfClosing // Title specifies extra information about an element. Title(v string) HTMLElemSelfClosing // XMLNS specifies the xml namespace of the element. XMLNS(v string) HTMLElemSelfClosing // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing } // ElemSelfClosing returns an HTML element that represents a self closing custom HTML element. func ElemSelfClosing(tag string) HTMLElemSelfClosing { e := &htmlElemSelfClosing{ htmlElement: htmlElement{ tag: tag, isSelfClosing: true, }, } return e } type htmlElemSelfClosing struct { htmlElement } func (e *htmlElemSelfClosing) AccessKey(v string) HTMLElemSelfClosing { e.setAttr("accesskey", v) return e } func (e *htmlElemSelfClosing) Aria(k string, v any) HTMLElemSelfClosing { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlElemSelfClosing) Attr(n string, v any) HTMLElemSelfClosing { e.setAttr(n, v) return e } func (e *htmlElemSelfClosing) Class(v ...string) HTMLElemSelfClosing { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlElemSelfClosing) ContentEditable(v bool) HTMLElemSelfClosing { e.setAttr("contenteditable", v) return e } func (e *htmlElemSelfClosing) DataSet(k string, v any) HTMLElemSelfClosing { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlElemSelfClosing) Dir(v string) HTMLElemSelfClosing { e.setAttr("dir", v) return e } func (e *htmlElemSelfClosing) Draggable(v bool) HTMLElemSelfClosing { e.setAttr("draggable", v) return e } func (e *htmlElemSelfClosing) Hidden(v bool) HTMLElemSelfClosing { e.setAttr("hidden", v) return e } func (e *htmlElemSelfClosing) ID(v string) HTMLElemSelfClosing { e.setAttr("id", v) return e } func (e *htmlElemSelfClosing) Lang(v string) HTMLElemSelfClosing { e.setAttr("lang", v) return e } func (e *htmlElemSelfClosing) Role(v string) HTMLElemSelfClosing { e.setAttr("role", v) return e } func (e *htmlElemSelfClosing) Spellcheck(v bool) HTMLElemSelfClosing { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlElemSelfClosing) Style(k, v string) HTMLElemSelfClosing { e.setAttr("style", k+":"+v) return e } func (e *htmlElemSelfClosing) Styles(s map[string]string) HTMLElemSelfClosing { for k, v := range s { e.Style(k, v) } return e } func (e *htmlElemSelfClosing) TabIndex(v int) HTMLElemSelfClosing { e.setAttr("tabindex", v) return e } func (e *htmlElemSelfClosing) Title(v string) HTMLElemSelfClosing { e.setAttr("title", v) return e } func (e *htmlElemSelfClosing) XMLNS(v string) HTMLElemSelfClosing { e.xmlns = v return e } func (e *htmlElemSelfClosing) On(event string, h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler(event, h, scope...) return e } func (e *htmlElemSelfClosing) OnBlur(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("blur", h, scope...) return e } func (e *htmlElemSelfClosing) OnChange(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("change", h, scope...) return e } func (e *htmlElemSelfClosing) OnClick(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("click", h, scope...) return e } func (e *htmlElemSelfClosing) OnContextMenu(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlElemSelfClosing) OnCopy(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("copy", h, scope...) return e } func (e *htmlElemSelfClosing) OnCut(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("cut", h, scope...) return e } func (e *htmlElemSelfClosing) OnDblClick(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlElemSelfClosing) OnDrag(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("drag", h, scope...) return e } func (e *htmlElemSelfClosing) OnDragEnd(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlElemSelfClosing) OnDragEnter(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlElemSelfClosing) OnDragLeave(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlElemSelfClosing) OnDragOver(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlElemSelfClosing) OnDragStart(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlElemSelfClosing) OnDrop(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("drop", h, scope...) return e } func (e *htmlElemSelfClosing) OnFocus(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("focus", h, scope...) return e } func (e *htmlElemSelfClosing) OnInput(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("input", h, scope...) return e } func (e *htmlElemSelfClosing) OnInvalid(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlElemSelfClosing) OnKeyDown(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlElemSelfClosing) OnKeyPress(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlElemSelfClosing) OnKeyUp(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlElemSelfClosing) OnMouseDown(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlElemSelfClosing) OnMouseMove(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlElemSelfClosing) OnMouseOut(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlElemSelfClosing) OnMouseOver(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlElemSelfClosing) OnMouseUp(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlElemSelfClosing) OnPaste(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("paste", h, scope...) return e } func (e *htmlElemSelfClosing) OnReset(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("reset", h, scope...) return e } func (e *htmlElemSelfClosing) OnScroll(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlElemSelfClosing) OnSearch(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("search", h, scope...) return e } func (e *htmlElemSelfClosing) OnSelect(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("select", h, scope...) return e } func (e *htmlElemSelfClosing) OnSubmit(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("submit", h, scope...) return e } func (e *htmlElemSelfClosing) OnWheel(h EventHandler, scope ...any) HTMLElemSelfClosing { e.setEventHandler("wheel", h, scope...) return e } // HTMLEm is the interface that describes a "em" HTML element. type HTMLEm interface { UI // Body set the content of the element. Body(elems ...UI) HTMLEm // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLEm // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLEm // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLEm // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLEm // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLEm // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLEm // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLEm // Dir specifies the text direction for the content in an element. Dir(v string) HTMLEm // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLEm // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLEm // ID specifies a unique id for an element. ID(v string) HTMLEm // Lang specifies the language of the element's content. Lang(v string) HTMLEm // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLEm // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLEm // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLEm // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLEm // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLEm // Title specifies extra information about an element. Title(v string) HTMLEm // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLEm // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLEm // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLEm // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLEm // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLEm // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLEm // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLEm // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLEm // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLEm // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLEm // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLEm // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLEm // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLEm // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLEm // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLEm // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLEm // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLEm // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLEm // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLEm // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLEm // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLEm // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLEm // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLEm // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLEm // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLEm // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLEm // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLEm // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLEm // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLEm // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLEm // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLEm // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLEm // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLEm } // Em returns an HTML element that defines emphasized text. func Em() HTMLEm { e := &htmlEm{ htmlElement: htmlElement{ tag: "em", isSelfClosing: false, }, } return e } type htmlEm struct { htmlElement } func (e *htmlEm) Body(v ...UI) HTMLEm { e.setChildren(v...) return e } func (e *htmlEm) Text(v any) HTMLEm { return e.Body(Text(v)) } func (e *htmlEm) AccessKey(v string) HTMLEm { e.setAttr("accesskey", v) return e } func (e *htmlEm) Aria(k string, v any) HTMLEm { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlEm) Attr(n string, v any) HTMLEm { e.setAttr(n, v) return e } func (e *htmlEm) Class(v ...string) HTMLEm { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlEm) ContentEditable(v bool) HTMLEm { e.setAttr("contenteditable", v) return e } func (e *htmlEm) DataSet(k string, v any) HTMLEm { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlEm) Dir(v string) HTMLEm { e.setAttr("dir", v) return e } func (e *htmlEm) Draggable(v bool) HTMLEm { e.setAttr("draggable", v) return e } func (e *htmlEm) Hidden(v bool) HTMLEm { e.setAttr("hidden", v) return e } func (e *htmlEm) ID(v string) HTMLEm { e.setAttr("id", v) return e } func (e *htmlEm) Lang(v string) HTMLEm { e.setAttr("lang", v) return e } func (e *htmlEm) Role(v string) HTMLEm { e.setAttr("role", v) return e } func (e *htmlEm) Spellcheck(v bool) HTMLEm { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlEm) Style(k, v string) HTMLEm { e.setAttr("style", k+":"+v) return e } func (e *htmlEm) Styles(s map[string]string) HTMLEm { for k, v := range s { e.Style(k, v) } return e } func (e *htmlEm) TabIndex(v int) HTMLEm { e.setAttr("tabindex", v) return e } func (e *htmlEm) Title(v string) HTMLEm { e.setAttr("title", v) return e } func (e *htmlEm) On(event string, h EventHandler, scope ...any) HTMLEm { e.setEventHandler(event, h, scope...) return e } func (e *htmlEm) OnBlur(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("blur", h, scope...) return e } func (e *htmlEm) OnChange(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("change", h, scope...) return e } func (e *htmlEm) OnClick(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("click", h, scope...) return e } func (e *htmlEm) OnContextMenu(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlEm) OnCopy(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("copy", h, scope...) return e } func (e *htmlEm) OnCut(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("cut", h, scope...) return e } func (e *htmlEm) OnDblClick(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlEm) OnDrag(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("drag", h, scope...) return e } func (e *htmlEm) OnDragEnd(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlEm) OnDragEnter(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlEm) OnDragLeave(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlEm) OnDragOver(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlEm) OnDragStart(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlEm) OnDrop(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("drop", h, scope...) return e } func (e *htmlEm) OnFocus(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("focus", h, scope...) return e } func (e *htmlEm) OnInput(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("input", h, scope...) return e } func (e *htmlEm) OnInvalid(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlEm) OnKeyDown(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlEm) OnKeyPress(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlEm) OnKeyUp(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlEm) OnMouseDown(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlEm) OnMouseMove(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlEm) OnMouseOut(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlEm) OnMouseOver(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlEm) OnMouseUp(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlEm) OnPaste(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("paste", h, scope...) return e } func (e *htmlEm) OnReset(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("reset", h, scope...) return e } func (e *htmlEm) OnScroll(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlEm) OnSearch(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("search", h, scope...) return e } func (e *htmlEm) OnSelect(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("select", h, scope...) return e } func (e *htmlEm) OnSubmit(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("submit", h, scope...) return e } func (e *htmlEm) OnWheel(h EventHandler, scope ...any) HTMLEm { e.setEventHandler("wheel", h, scope...) return e } // HTMLEmbed is the interface that describes a "embed" HTML element. type HTMLEmbed interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLEmbed // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLEmbed // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLEmbed // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLEmbed // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLEmbed // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLEmbed // Dir specifies the text direction for the content in an element. Dir(v string) HTMLEmbed // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLEmbed // Height specifies the height of the element (in pixels). Height(v int) HTMLEmbed // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLEmbed // ID specifies a unique id for an element. ID(v string) HTMLEmbed // Lang specifies the language of the element's content. Lang(v string) HTMLEmbed // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLEmbed // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLEmbed // Src specifies the URL of the media file. Src(v string) HTMLEmbed // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLEmbed // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLEmbed // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLEmbed // Title specifies extra information about an element. Title(v string) HTMLEmbed // Type specifies the type of element. Type(v string) HTMLEmbed // Width specifies the width of the element. Width(v int) HTMLEmbed // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLEmbed // OnAbort calls the given handler on abort. OnAbort(h EventHandler, scope ...any) HTMLEmbed // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLEmbed // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin). OnCanPlay(h EventHandler, scope ...any) HTMLEmbed // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering. OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLEmbed // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLEmbed // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLEmbed // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLEmbed // OnCueChange calls the given handler when the cue changes in a track element. OnCueChange(h EventHandler, scope ...any) HTMLEmbed // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLEmbed // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLEmbed // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLEmbed // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLEmbed // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLEmbed // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLEmbed // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLEmbed // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLEmbed // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLEmbed // OnDurationChange calls the given handler when the length of the media changes. OnDurationChange(h EventHandler, scope ...any) HTMLEmbed // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects). OnEmptied(h EventHandler, scope ...any) HTMLEmbed // OnEnded calls the given handler when the media has reach the end. OnEnded(h EventHandler, scope ...any) HTMLEmbed // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLEmbed // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLEmbed // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLEmbed // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLEmbed // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLEmbed // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLEmbed // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLEmbed // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded. OnLoadStart(h EventHandler, scope ...any) HTMLEmbed // OnLoadedData calls the given handler when media data is loaded. OnLoadedData(h EventHandler, scope ...any) HTMLEmbed // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded. OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLEmbed // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLEmbed // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLEmbed // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLEmbed // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLEmbed // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLEmbed // OnPause calls the given handler when the media is paused either by the user or programmatically. OnPause(h EventHandler, scope ...any) HTMLEmbed // OnPlay calls the given handler when the media is ready to start playing. OnPlay(h EventHandler, scope ...any) HTMLEmbed // OnPlaying calls the given handler when the media actually has started playing. OnPlaying(h EventHandler, scope ...any) HTMLEmbed // OnProgress calls the given handler when the browser is in the process of getting the media data. OnProgress(h EventHandler, scope ...any) HTMLEmbed // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). OnRateChange(h EventHandler, scope ...any) HTMLEmbed // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLEmbed // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLEmbed // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLEmbed // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended. OnSeeked(h EventHandler, scope ...any) HTMLEmbed // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active. OnSeeking(h EventHandler, scope ...any) HTMLEmbed // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLEmbed // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason. OnStalled(h EventHandler, scope ...any) HTMLEmbed // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLEmbed // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason. OnSuspend(h EventHandler, scope ...any) HTMLEmbed // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media). OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute"). OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data). OnWaiting(h EventHandler, scope ...any) HTMLEmbed // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLEmbed } // Embed returns an HTML element that defines a container for an external (non-HTML) application. func Embed() HTMLEmbed { e := &htmlEmbed{ htmlElement: htmlElement{ tag: "embed", isSelfClosing: true, }, } return e } type htmlEmbed struct { htmlElement } func (e *htmlEmbed) AccessKey(v string) HTMLEmbed { e.setAttr("accesskey", v) return e } func (e *htmlEmbed) Aria(k string, v any) HTMLEmbed { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlEmbed) Attr(n string, v any) HTMLEmbed { e.setAttr(n, v) return e } func (e *htmlEmbed) Class(v ...string) HTMLEmbed { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlEmbed) ContentEditable(v bool) HTMLEmbed { e.setAttr("contenteditable", v) return e } func (e *htmlEmbed) DataSet(k string, v any) HTMLEmbed { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlEmbed) Dir(v string) HTMLEmbed { e.setAttr("dir", v) return e } func (e *htmlEmbed) Draggable(v bool) HTMLEmbed { e.setAttr("draggable", v) return e } func (e *htmlEmbed) Height(v int) HTMLEmbed { e.setAttr("height", v) return e } func (e *htmlEmbed) Hidden(v bool) HTMLEmbed { e.setAttr("hidden", v) return e } func (e *htmlEmbed) ID(v string) HTMLEmbed { e.setAttr("id", v) return e } func (e *htmlEmbed) Lang(v string) HTMLEmbed { e.setAttr("lang", v) return e } func (e *htmlEmbed) Role(v string) HTMLEmbed { e.setAttr("role", v) return e } func (e *htmlEmbed) Spellcheck(v bool) HTMLEmbed { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlEmbed) Src(v string) HTMLEmbed { e.setAttr("src", v) return e } func (e *htmlEmbed) Style(k, v string) HTMLEmbed { e.setAttr("style", k+":"+v) return e } func (e *htmlEmbed) Styles(s map[string]string) HTMLEmbed { for k, v := range s { e.Style(k, v) } return e } func (e *htmlEmbed) TabIndex(v int) HTMLEmbed { e.setAttr("tabindex", v) return e } func (e *htmlEmbed) Title(v string) HTMLEmbed { e.setAttr("title", v) return e } func (e *htmlEmbed) Type(v string) HTMLEmbed { e.setAttr("type", v) return e } func (e *htmlEmbed) Width(v int) HTMLEmbed { e.setAttr("width", v) return e } func (e *htmlEmbed) On(event string, h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler(event, h, scope...) return e } func (e *htmlEmbed) OnAbort(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("abort", h, scope...) return e } func (e *htmlEmbed) OnBlur(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("blur", h, scope...) return e } func (e *htmlEmbed) OnCanPlay(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("canplay", h, scope...) return e } func (e *htmlEmbed) OnCanPlayThrough(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("canplaythrough", h, scope...) return e } func (e *htmlEmbed) OnChange(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("change", h, scope...) return e } func (e *htmlEmbed) OnClick(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("click", h, scope...) return e } func (e *htmlEmbed) OnContextMenu(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlEmbed) OnCopy(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("copy", h, scope...) return e } func (e *htmlEmbed) OnCueChange(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("cuechange", h, scope...) return e } func (e *htmlEmbed) OnCut(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("cut", h, scope...) return e } func (e *htmlEmbed) OnDblClick(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlEmbed) OnDrag(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("drag", h, scope...) return e } func (e *htmlEmbed) OnDragEnd(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlEmbed) OnDragEnter(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlEmbed) OnDragLeave(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlEmbed) OnDragOver(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlEmbed) OnDragStart(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlEmbed) OnDrop(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("drop", h, scope...) return e } func (e *htmlEmbed) OnDurationChange(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("durationchange", h, scope...) return e } func (e *htmlEmbed) OnEmptied(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("emptied", h, scope...) return e } func (e *htmlEmbed) OnEnded(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("ended", h, scope...) return e } func (e *htmlEmbed) OnError(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("error", h, scope...) return e } func (e *htmlEmbed) OnFocus(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("focus", h, scope...) return e } func (e *htmlEmbed) OnInput(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("input", h, scope...) return e } func (e *htmlEmbed) OnInvalid(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlEmbed) OnKeyDown(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlEmbed) OnKeyPress(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlEmbed) OnKeyUp(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlEmbed) OnLoadStart(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("loadstart", h, scope...) return e } func (e *htmlEmbed) OnLoadedData(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("loadeddata", h, scope...) return e } func (e *htmlEmbed) OnLoadedMetaData(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("loadedmetadata", h, scope...) return e } func (e *htmlEmbed) OnMouseDown(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlEmbed) OnMouseMove(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlEmbed) OnMouseOut(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlEmbed) OnMouseOver(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlEmbed) OnMouseUp(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlEmbed) OnPaste(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("paste", h, scope...) return e } func (e *htmlEmbed) OnPause(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("pause", h, scope...) return e } func (e *htmlEmbed) OnPlay(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("play", h, scope...) return e } func (e *htmlEmbed) OnPlaying(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("playing", h, scope...) return e } func (e *htmlEmbed) OnProgress(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("progress", h, scope...) return e } func (e *htmlEmbed) OnRateChange(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("ratechange", h, scope...) return e } func (e *htmlEmbed) OnReset(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("reset", h, scope...) return e } func (e *htmlEmbed) OnScroll(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlEmbed) OnSearch(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("search", h, scope...) return e } func (e *htmlEmbed) OnSeeked(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("seeked", h, scope...) return e } func (e *htmlEmbed) OnSeeking(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("seeking", h, scope...) return e } func (e *htmlEmbed) OnSelect(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("select", h, scope...) return e } func (e *htmlEmbed) OnStalled(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("stalled", h, scope...) return e } func (e *htmlEmbed) OnSubmit(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("submit", h, scope...) return e } func (e *htmlEmbed) OnSuspend(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("suspend", h, scope...) return e } func (e *htmlEmbed) OnTimeUpdate(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("timeupdate", h, scope...) return e } func (e *htmlEmbed) OnVolumeChange(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("volumechange", h, scope...) return e } func (e *htmlEmbed) OnWaiting(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("waiting", h, scope...) return e } func (e *htmlEmbed) OnWheel(h EventHandler, scope ...any) HTMLEmbed { e.setEventHandler("wheel", h, scope...) return e } // HTMLFieldSet is the interface that describes a "fieldset" HTML element. type HTMLFieldSet interface { UI // Body set the content of the element. Body(elems ...UI) HTMLFieldSet // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLFieldSet // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLFieldSet // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLFieldSet // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLFieldSet // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLFieldSet // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLFieldSet // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLFieldSet // Dir specifies the text direction for the content in an element. Dir(v string) HTMLFieldSet // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLFieldSet // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLFieldSet // Form specifies the name of the form the element belongs to. Form(v string) HTMLFieldSet // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLFieldSet // ID specifies a unique id for an element. ID(v string) HTMLFieldSet // Lang specifies the language of the element's content. Lang(v string) HTMLFieldSet // Name specifies the name of the element. Name(v string) HTMLFieldSet // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLFieldSet // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLFieldSet // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLFieldSet // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLFieldSet // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLFieldSet // Title specifies extra information about an element. Title(v string) HTMLFieldSet // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLFieldSet // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLFieldSet // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLFieldSet // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLFieldSet // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLFieldSet // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLFieldSet // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLFieldSet // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLFieldSet // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLFieldSet // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLFieldSet // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLFieldSet // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLFieldSet // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLFieldSet // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLFieldSet // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLFieldSet // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLFieldSet // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLFieldSet // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLFieldSet // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLFieldSet // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLFieldSet // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLFieldSet } // FieldSet returns an HTML element that groups related elements in a form. func FieldSet() HTMLFieldSet { e := &htmlFieldSet{ htmlElement: htmlElement{ tag: "fieldset", isSelfClosing: false, }, } return e } type htmlFieldSet struct { htmlElement } func (e *htmlFieldSet) Body(v ...UI) HTMLFieldSet { e.setChildren(v...) return e } func (e *htmlFieldSet) Text(v any) HTMLFieldSet { return e.Body(Text(v)) } func (e *htmlFieldSet) AccessKey(v string) HTMLFieldSet { e.setAttr("accesskey", v) return e } func (e *htmlFieldSet) Aria(k string, v any) HTMLFieldSet { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFieldSet) Attr(n string, v any) HTMLFieldSet { e.setAttr(n, v) return e } func (e *htmlFieldSet) Class(v ...string) HTMLFieldSet { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlFieldSet) ContentEditable(v bool) HTMLFieldSet { e.setAttr("contenteditable", v) return e } func (e *htmlFieldSet) DataSet(k string, v any) HTMLFieldSet { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFieldSet) Dir(v string) HTMLFieldSet { e.setAttr("dir", v) return e } func (e *htmlFieldSet) Disabled(v bool) HTMLFieldSet { e.setAttr("disabled", v) return e } func (e *htmlFieldSet) Draggable(v bool) HTMLFieldSet { e.setAttr("draggable", v) return e } func (e *htmlFieldSet) Form(v string) HTMLFieldSet { e.setAttr("form", v) return e } func (e *htmlFieldSet) Hidden(v bool) HTMLFieldSet { e.setAttr("hidden", v) return e } func (e *htmlFieldSet) ID(v string) HTMLFieldSet { e.setAttr("id", v) return e } func (e *htmlFieldSet) Lang(v string) HTMLFieldSet { e.setAttr("lang", v) return e } func (e *htmlFieldSet) Name(v string) HTMLFieldSet { e.setAttr("name", v) return e } func (e *htmlFieldSet) Role(v string) HTMLFieldSet { e.setAttr("role", v) return e } func (e *htmlFieldSet) Spellcheck(v bool) HTMLFieldSet { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlFieldSet) Style(k, v string) HTMLFieldSet { e.setAttr("style", k+":"+v) return e } func (e *htmlFieldSet) Styles(s map[string]string) HTMLFieldSet { for k, v := range s { e.Style(k, v) } return e } func (e *htmlFieldSet) TabIndex(v int) HTMLFieldSet { e.setAttr("tabindex", v) return e } func (e *htmlFieldSet) Title(v string) HTMLFieldSet { e.setAttr("title", v) return e } func (e *htmlFieldSet) On(event string, h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler(event, h, scope...) return e } func (e *htmlFieldSet) OnBlur(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("blur", h, scope...) return e } func (e *htmlFieldSet) OnChange(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("change", h, scope...) return e } func (e *htmlFieldSet) OnClick(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("click", h, scope...) return e } func (e *htmlFieldSet) OnContextMenu(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlFieldSet) OnCopy(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("copy", h, scope...) return e } func (e *htmlFieldSet) OnCut(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("cut", h, scope...) return e } func (e *htmlFieldSet) OnDblClick(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlFieldSet) OnDrag(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("drag", h, scope...) return e } func (e *htmlFieldSet) OnDragEnd(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlFieldSet) OnDragEnter(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlFieldSet) OnDragLeave(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlFieldSet) OnDragOver(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlFieldSet) OnDragStart(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlFieldSet) OnDrop(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("drop", h, scope...) return e } func (e *htmlFieldSet) OnFocus(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("focus", h, scope...) return e } func (e *htmlFieldSet) OnInput(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("input", h, scope...) return e } func (e *htmlFieldSet) OnInvalid(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlFieldSet) OnKeyDown(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlFieldSet) OnKeyPress(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlFieldSet) OnKeyUp(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlFieldSet) OnMouseDown(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlFieldSet) OnMouseMove(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlFieldSet) OnMouseOut(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlFieldSet) OnMouseOver(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlFieldSet) OnMouseUp(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlFieldSet) OnPaste(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("paste", h, scope...) return e } func (e *htmlFieldSet) OnReset(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("reset", h, scope...) return e } func (e *htmlFieldSet) OnScroll(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlFieldSet) OnSearch(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("search", h, scope...) return e } func (e *htmlFieldSet) OnSelect(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("select", h, scope...) return e } func (e *htmlFieldSet) OnSubmit(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("submit", h, scope...) return e } func (e *htmlFieldSet) OnWheel(h EventHandler, scope ...any) HTMLFieldSet { e.setEventHandler("wheel", h, scope...) return e } // HTMLFigCaption is the interface that describes a "figcaption" HTML element. type HTMLFigCaption interface { UI // Body set the content of the element. Body(elems ...UI) HTMLFigCaption // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLFigCaption // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLFigCaption // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLFigCaption // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLFigCaption // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLFigCaption // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLFigCaption // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLFigCaption // Dir specifies the text direction for the content in an element. Dir(v string) HTMLFigCaption // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLFigCaption // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLFigCaption // ID specifies a unique id for an element. ID(v string) HTMLFigCaption // Lang specifies the language of the element's content. Lang(v string) HTMLFigCaption // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLFigCaption // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLFigCaption // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLFigCaption // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLFigCaption // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLFigCaption // Title specifies extra information about an element. Title(v string) HTMLFigCaption // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLFigCaption // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLFigCaption // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLFigCaption // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLFigCaption // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLFigCaption // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLFigCaption // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLFigCaption // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLFigCaption // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLFigCaption // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLFigCaption // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLFigCaption // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLFigCaption // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLFigCaption // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLFigCaption // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLFigCaption // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLFigCaption // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLFigCaption // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLFigCaption // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLFigCaption // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLFigCaption // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLFigCaption } // FigCaption returns an HTML element that defines a caption for a figure element. func FigCaption() HTMLFigCaption { e := &htmlFigCaption{ htmlElement: htmlElement{ tag: "figcaption", isSelfClosing: false, }, } return e } type htmlFigCaption struct { htmlElement } func (e *htmlFigCaption) Body(v ...UI) HTMLFigCaption { e.setChildren(v...) return e } func (e *htmlFigCaption) Text(v any) HTMLFigCaption { return e.Body(Text(v)) } func (e *htmlFigCaption) AccessKey(v string) HTMLFigCaption { e.setAttr("accesskey", v) return e } func (e *htmlFigCaption) Aria(k string, v any) HTMLFigCaption { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFigCaption) Attr(n string, v any) HTMLFigCaption { e.setAttr(n, v) return e } func (e *htmlFigCaption) Class(v ...string) HTMLFigCaption { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlFigCaption) ContentEditable(v bool) HTMLFigCaption { e.setAttr("contenteditable", v) return e } func (e *htmlFigCaption) DataSet(k string, v any) HTMLFigCaption { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFigCaption) Dir(v string) HTMLFigCaption { e.setAttr("dir", v) return e } func (e *htmlFigCaption) Draggable(v bool) HTMLFigCaption { e.setAttr("draggable", v) return e } func (e *htmlFigCaption) Hidden(v bool) HTMLFigCaption { e.setAttr("hidden", v) return e } func (e *htmlFigCaption) ID(v string) HTMLFigCaption { e.setAttr("id", v) return e } func (e *htmlFigCaption) Lang(v string) HTMLFigCaption { e.setAttr("lang", v) return e } func (e *htmlFigCaption) Role(v string) HTMLFigCaption { e.setAttr("role", v) return e } func (e *htmlFigCaption) Spellcheck(v bool) HTMLFigCaption { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlFigCaption) Style(k, v string) HTMLFigCaption { e.setAttr("style", k+":"+v) return e } func (e *htmlFigCaption) Styles(s map[string]string) HTMLFigCaption { for k, v := range s { e.Style(k, v) } return e } func (e *htmlFigCaption) TabIndex(v int) HTMLFigCaption { e.setAttr("tabindex", v) return e } func (e *htmlFigCaption) Title(v string) HTMLFigCaption { e.setAttr("title", v) return e } func (e *htmlFigCaption) On(event string, h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler(event, h, scope...) return e } func (e *htmlFigCaption) OnBlur(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("blur", h, scope...) return e } func (e *htmlFigCaption) OnChange(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("change", h, scope...) return e } func (e *htmlFigCaption) OnClick(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("click", h, scope...) return e } func (e *htmlFigCaption) OnContextMenu(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlFigCaption) OnCopy(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("copy", h, scope...) return e } func (e *htmlFigCaption) OnCut(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("cut", h, scope...) return e } func (e *htmlFigCaption) OnDblClick(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlFigCaption) OnDrag(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("drag", h, scope...) return e } func (e *htmlFigCaption) OnDragEnd(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlFigCaption) OnDragEnter(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlFigCaption) OnDragLeave(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlFigCaption) OnDragOver(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlFigCaption) OnDragStart(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlFigCaption) OnDrop(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("drop", h, scope...) return e } func (e *htmlFigCaption) OnFocus(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("focus", h, scope...) return e } func (e *htmlFigCaption) OnInput(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("input", h, scope...) return e } func (e *htmlFigCaption) OnInvalid(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlFigCaption) OnKeyDown(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlFigCaption) OnKeyPress(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlFigCaption) OnKeyUp(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlFigCaption) OnMouseDown(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlFigCaption) OnMouseMove(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlFigCaption) OnMouseOut(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlFigCaption) OnMouseOver(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlFigCaption) OnMouseUp(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlFigCaption) OnPaste(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("paste", h, scope...) return e } func (e *htmlFigCaption) OnReset(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("reset", h, scope...) return e } func (e *htmlFigCaption) OnScroll(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlFigCaption) OnSearch(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("search", h, scope...) return e } func (e *htmlFigCaption) OnSelect(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("select", h, scope...) return e } func (e *htmlFigCaption) OnSubmit(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("submit", h, scope...) return e } func (e *htmlFigCaption) OnWheel(h EventHandler, scope ...any) HTMLFigCaption { e.setEventHandler("wheel", h, scope...) return e } // HTMLFigure is the interface that describes a "figure" HTML element. type HTMLFigure interface { UI // Body set the content of the element. Body(elems ...UI) HTMLFigure // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLFigure // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLFigure // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLFigure // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLFigure // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLFigure // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLFigure // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLFigure // Dir specifies the text direction for the content in an element. Dir(v string) HTMLFigure // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLFigure // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLFigure // ID specifies a unique id for an element. ID(v string) HTMLFigure // Lang specifies the language of the element's content. Lang(v string) HTMLFigure // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLFigure // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLFigure // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLFigure // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLFigure // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLFigure // Title specifies extra information about an element. Title(v string) HTMLFigure // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLFigure // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLFigure // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLFigure // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLFigure // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLFigure // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLFigure // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLFigure // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLFigure // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLFigure // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLFigure // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLFigure // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLFigure // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLFigure // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLFigure // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLFigure // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLFigure // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLFigure // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLFigure // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLFigure // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLFigure // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLFigure // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLFigure // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLFigure // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLFigure // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLFigure // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLFigure // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLFigure // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLFigure // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLFigure // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLFigure // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLFigure // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLFigure // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLFigure } // Figure returns an HTML element that specifies self-contained content. func Figure() HTMLFigure { e := &htmlFigure{ htmlElement: htmlElement{ tag: "figure", isSelfClosing: false, }, } return e } type htmlFigure struct { htmlElement } func (e *htmlFigure) Body(v ...UI) HTMLFigure { e.setChildren(v...) return e } func (e *htmlFigure) Text(v any) HTMLFigure { return e.Body(Text(v)) } func (e *htmlFigure) AccessKey(v string) HTMLFigure { e.setAttr("accesskey", v) return e } func (e *htmlFigure) Aria(k string, v any) HTMLFigure { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFigure) Attr(n string, v any) HTMLFigure { e.setAttr(n, v) return e } func (e *htmlFigure) Class(v ...string) HTMLFigure { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlFigure) ContentEditable(v bool) HTMLFigure { e.setAttr("contenteditable", v) return e } func (e *htmlFigure) DataSet(k string, v any) HTMLFigure { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFigure) Dir(v string) HTMLFigure { e.setAttr("dir", v) return e } func (e *htmlFigure) Draggable(v bool) HTMLFigure { e.setAttr("draggable", v) return e } func (e *htmlFigure) Hidden(v bool) HTMLFigure { e.setAttr("hidden", v) return e } func (e *htmlFigure) ID(v string) HTMLFigure { e.setAttr("id", v) return e } func (e *htmlFigure) Lang(v string) HTMLFigure { e.setAttr("lang", v) return e } func (e *htmlFigure) Role(v string) HTMLFigure { e.setAttr("role", v) return e } func (e *htmlFigure) Spellcheck(v bool) HTMLFigure { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlFigure) Style(k, v string) HTMLFigure { e.setAttr("style", k+":"+v) return e } func (e *htmlFigure) Styles(s map[string]string) HTMLFigure { for k, v := range s { e.Style(k, v) } return e } func (e *htmlFigure) TabIndex(v int) HTMLFigure { e.setAttr("tabindex", v) return e } func (e *htmlFigure) Title(v string) HTMLFigure { e.setAttr("title", v) return e } func (e *htmlFigure) On(event string, h EventHandler, scope ...any) HTMLFigure { e.setEventHandler(event, h, scope...) return e } func (e *htmlFigure) OnBlur(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("blur", h, scope...) return e } func (e *htmlFigure) OnChange(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("change", h, scope...) return e } func (e *htmlFigure) OnClick(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("click", h, scope...) return e } func (e *htmlFigure) OnContextMenu(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlFigure) OnCopy(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("copy", h, scope...) return e } func (e *htmlFigure) OnCut(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("cut", h, scope...) return e } func (e *htmlFigure) OnDblClick(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlFigure) OnDrag(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("drag", h, scope...) return e } func (e *htmlFigure) OnDragEnd(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlFigure) OnDragEnter(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlFigure) OnDragLeave(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlFigure) OnDragOver(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlFigure) OnDragStart(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlFigure) OnDrop(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("drop", h, scope...) return e } func (e *htmlFigure) OnFocus(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("focus", h, scope...) return e } func (e *htmlFigure) OnInput(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("input", h, scope...) return e } func (e *htmlFigure) OnInvalid(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlFigure) OnKeyDown(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlFigure) OnKeyPress(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlFigure) OnKeyUp(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlFigure) OnMouseDown(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlFigure) OnMouseMove(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlFigure) OnMouseOut(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlFigure) OnMouseOver(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlFigure) OnMouseUp(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlFigure) OnPaste(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("paste", h, scope...) return e } func (e *htmlFigure) OnReset(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("reset", h, scope...) return e } func (e *htmlFigure) OnScroll(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlFigure) OnSearch(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("search", h, scope...) return e } func (e *htmlFigure) OnSelect(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("select", h, scope...) return e } func (e *htmlFigure) OnSubmit(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("submit", h, scope...) return e } func (e *htmlFigure) OnWheel(h EventHandler, scope ...any) HTMLFigure { e.setEventHandler("wheel", h, scope...) return e } // HTMLFooter is the interface that describes a "footer" HTML element. type HTMLFooter interface { UI // Body set the content of the element. Body(elems ...UI) HTMLFooter // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLFooter // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLFooter // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLFooter // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLFooter // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLFooter // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLFooter // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLFooter // Dir specifies the text direction for the content in an element. Dir(v string) HTMLFooter // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLFooter // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLFooter // ID specifies a unique id for an element. ID(v string) HTMLFooter // Lang specifies the language of the element's content. Lang(v string) HTMLFooter // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLFooter // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLFooter // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLFooter // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLFooter // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLFooter // Title specifies extra information about an element. Title(v string) HTMLFooter // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLFooter // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLFooter // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLFooter // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLFooter // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLFooter // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLFooter // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLFooter // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLFooter // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLFooter // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLFooter // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLFooter // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLFooter // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLFooter // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLFooter // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLFooter // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLFooter // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLFooter // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLFooter // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLFooter // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLFooter // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLFooter // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLFooter // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLFooter // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLFooter // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLFooter // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLFooter // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLFooter // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLFooter // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLFooter // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLFooter // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLFooter // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLFooter // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLFooter } // Footer returns an HTML element that defines a footer for a document or section. func Footer() HTMLFooter { e := &htmlFooter{ htmlElement: htmlElement{ tag: "footer", isSelfClosing: false, }, } return e } type htmlFooter struct { htmlElement } func (e *htmlFooter) Body(v ...UI) HTMLFooter { e.setChildren(v...) return e } func (e *htmlFooter) Text(v any) HTMLFooter { return e.Body(Text(v)) } func (e *htmlFooter) AccessKey(v string) HTMLFooter { e.setAttr("accesskey", v) return e } func (e *htmlFooter) Aria(k string, v any) HTMLFooter { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFooter) Attr(n string, v any) HTMLFooter { e.setAttr(n, v) return e } func (e *htmlFooter) Class(v ...string) HTMLFooter { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlFooter) ContentEditable(v bool) HTMLFooter { e.setAttr("contenteditable", v) return e } func (e *htmlFooter) DataSet(k string, v any) HTMLFooter { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlFooter) Dir(v string) HTMLFooter { e.setAttr("dir", v) return e } func (e *htmlFooter) Draggable(v bool) HTMLFooter { e.setAttr("draggable", v) return e } func (e *htmlFooter) Hidden(v bool) HTMLFooter { e.setAttr("hidden", v) return e } func (e *htmlFooter) ID(v string) HTMLFooter { e.setAttr("id", v) return e } func (e *htmlFooter) Lang(v string) HTMLFooter { e.setAttr("lang", v) return e } func (e *htmlFooter) Role(v string) HTMLFooter { e.setAttr("role", v) return e } func (e *htmlFooter) Spellcheck(v bool) HTMLFooter { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlFooter) Style(k, v string) HTMLFooter { e.setAttr("style", k+":"+v) return e } func (e *htmlFooter) Styles(s map[string]string) HTMLFooter { for k, v := range s { e.Style(k, v) } return e } func (e *htmlFooter) TabIndex(v int) HTMLFooter { e.setAttr("tabindex", v) return e } func (e *htmlFooter) Title(v string) HTMLFooter { e.setAttr("title", v) return e } func (e *htmlFooter) On(event string, h EventHandler, scope ...any) HTMLFooter { e.setEventHandler(event, h, scope...) return e } func (e *htmlFooter) OnBlur(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("blur", h, scope...) return e } func (e *htmlFooter) OnChange(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("change", h, scope...) return e } func (e *htmlFooter) OnClick(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("click", h, scope...) return e } func (e *htmlFooter) OnContextMenu(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlFooter) OnCopy(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("copy", h, scope...) return e } func (e *htmlFooter) OnCut(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("cut", h, scope...) return e } func (e *htmlFooter) OnDblClick(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlFooter) OnDrag(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("drag", h, scope...) return e } func (e *htmlFooter) OnDragEnd(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlFooter) OnDragEnter(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlFooter) OnDragLeave(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlFooter) OnDragOver(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlFooter) OnDragStart(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlFooter) OnDrop(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("drop", h, scope...) return e } func (e *htmlFooter) OnFocus(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("focus", h, scope...) return e } func (e *htmlFooter) OnInput(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("input", h, scope...) return e } func (e *htmlFooter) OnInvalid(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlFooter) OnKeyDown(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlFooter) OnKeyPress(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlFooter) OnKeyUp(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlFooter) OnMouseDown(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlFooter) OnMouseMove(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlFooter) OnMouseOut(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlFooter) OnMouseOver(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlFooter) OnMouseUp(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlFooter) OnPaste(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("paste", h, scope...) return e } func (e *htmlFooter) OnReset(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("reset", h, scope...) return e } func (e *htmlFooter) OnScroll(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlFooter) OnSearch(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("search", h, scope...) return e } func (e *htmlFooter) OnSelect(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("select", h, scope...) return e } func (e *htmlFooter) OnSubmit(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("submit", h, scope...) return e } func (e *htmlFooter) OnWheel(h EventHandler, scope ...any) HTMLFooter { e.setEventHandler("wheel", h, scope...) return e } // HTMLForm is the interface that describes a "form" HTML element. type HTMLForm interface { UI // Body set the content of the element. Body(elems ...UI) HTMLForm // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLForm // AcceptCharset specifies the character encodings that are to be used for the form submission. AcceptCharset(v string) HTMLForm // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLForm // Action specifies where to send the form-data when a form is submitted. Action(v string) HTMLForm // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLForm // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLForm // AutoComplete specifies whether the element should have autocomplete enabled. AutoComplete(v bool) HTMLForm // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLForm // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLForm // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLForm // Dir specifies the text direction for the content in an element. Dir(v string) HTMLForm // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLForm // EncType specifies how the form-data should be encoded when submitting it to the server (only for post method). EncType(v string) HTMLForm // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLForm // ID specifies a unique id for an element. ID(v string) HTMLForm // Lang specifies the language of the element's content. Lang(v string) HTMLForm // Method specifies the HTTP method to use when sending form-data. Method(v string) HTMLForm // Name specifies the name of the element. Name(v string) HTMLForm // NoValidate specifies that the form should not be validated when submitted. NoValidate(v bool) HTMLForm // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLForm // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLForm // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLForm // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLForm // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLForm // Target specifies the target for where to open the linked document or where to submit the form. Target(v string) HTMLForm // Title specifies extra information about an element. Title(v string) HTMLForm // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLForm // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLForm // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLForm // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLForm // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLForm // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLForm // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLForm // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLForm // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLForm // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLForm // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLForm // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLForm // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLForm // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLForm // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLForm // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLForm // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLForm // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLForm // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLForm // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLForm // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLForm // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLForm // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLForm // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLForm // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLForm // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLForm // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLForm // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLForm // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLForm // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLForm // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLForm // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLForm // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLForm } // Form returns an HTML element that defines an HTML form for user input. func Form() HTMLForm { e := &htmlForm{ htmlElement: htmlElement{ tag: "form", isSelfClosing: false, }, } return e } type htmlForm struct { htmlElement } func (e *htmlForm) Body(v ...UI) HTMLForm { e.setChildren(v...) return e } func (e *htmlForm) Text(v any) HTMLForm { return e.Body(Text(v)) } func (e *htmlForm) AcceptCharset(v string) HTMLForm { e.setAttr("accept-charset", v) return e } func (e *htmlForm) AccessKey(v string) HTMLForm { e.setAttr("accesskey", v) return e } func (e *htmlForm) Action(v string) HTMLForm { e.setAttr("action", v) return e } func (e *htmlForm) Aria(k string, v any) HTMLForm { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlForm) Attr(n string, v any) HTMLForm { e.setAttr(n, v) return e } func (e *htmlForm) AutoComplete(v bool) HTMLForm { s := "off" if v { s = "on" } e.setAttr("autocomplete", s) return e } func (e *htmlForm) Class(v ...string) HTMLForm { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlForm) ContentEditable(v bool) HTMLForm { e.setAttr("contenteditable", v) return e } func (e *htmlForm) DataSet(k string, v any) HTMLForm { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlForm) Dir(v string) HTMLForm { e.setAttr("dir", v) return e } func (e *htmlForm) Draggable(v bool) HTMLForm { e.setAttr("draggable", v) return e } func (e *htmlForm) EncType(v string) HTMLForm { e.setAttr("enctype", v) return e } func (e *htmlForm) Hidden(v bool) HTMLForm { e.setAttr("hidden", v) return e } func (e *htmlForm) ID(v string) HTMLForm { e.setAttr("id", v) return e } func (e *htmlForm) Lang(v string) HTMLForm { e.setAttr("lang", v) return e } func (e *htmlForm) Method(v string) HTMLForm { e.setAttr("method", v) return e } func (e *htmlForm) Name(v string) HTMLForm { e.setAttr("name", v) return e } func (e *htmlForm) NoValidate(v bool) HTMLForm { e.setAttr("novalidate", v) return e } func (e *htmlForm) Role(v string) HTMLForm { e.setAttr("role", v) return e } func (e *htmlForm) Spellcheck(v bool) HTMLForm { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlForm) Style(k, v string) HTMLForm { e.setAttr("style", k+":"+v) return e } func (e *htmlForm) Styles(s map[string]string) HTMLForm { for k, v := range s { e.Style(k, v) } return e } func (e *htmlForm) TabIndex(v int) HTMLForm { e.setAttr("tabindex", v) return e } func (e *htmlForm) Target(v string) HTMLForm { e.setAttr("target", v) return e } func (e *htmlForm) Title(v string) HTMLForm { e.setAttr("title", v) return e } func (e *htmlForm) On(event string, h EventHandler, scope ...any) HTMLForm { e.setEventHandler(event, h, scope...) return e } func (e *htmlForm) OnBlur(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("blur", h, scope...) return e } func (e *htmlForm) OnChange(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("change", h, scope...) return e } func (e *htmlForm) OnClick(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("click", h, scope...) return e } func (e *htmlForm) OnContextMenu(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlForm) OnCopy(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("copy", h, scope...) return e } func (e *htmlForm) OnCut(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("cut", h, scope...) return e } func (e *htmlForm) OnDblClick(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlForm) OnDrag(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("drag", h, scope...) return e } func (e *htmlForm) OnDragEnd(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlForm) OnDragEnter(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlForm) OnDragLeave(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlForm) OnDragOver(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlForm) OnDragStart(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlForm) OnDrop(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("drop", h, scope...) return e } func (e *htmlForm) OnFocus(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("focus", h, scope...) return e } func (e *htmlForm) OnInput(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("input", h, scope...) return e } func (e *htmlForm) OnInvalid(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlForm) OnKeyDown(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlForm) OnKeyPress(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlForm) OnKeyUp(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlForm) OnMouseDown(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlForm) OnMouseMove(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlForm) OnMouseOut(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlForm) OnMouseOver(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlForm) OnMouseUp(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlForm) OnPaste(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("paste", h, scope...) return e } func (e *htmlForm) OnReset(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("reset", h, scope...) return e } func (e *htmlForm) OnScroll(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlForm) OnSearch(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("search", h, scope...) return e } func (e *htmlForm) OnSelect(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("select", h, scope...) return e } func (e *htmlForm) OnSubmit(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("submit", h, scope...) return e } func (e *htmlForm) OnWheel(h EventHandler, scope ...any) HTMLForm { e.setEventHandler("wheel", h, scope...) return e } // HTMLH1 is the interface that describes a "h1" HTML element. type HTMLH1 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH1 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH1 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH1 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH1 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH1 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH1 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH1 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH1 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH1 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH1 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH1 // ID specifies a unique id for an element. ID(v string) HTMLH1 // Lang specifies the language of the element's content. Lang(v string) HTMLH1 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH1 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH1 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH1 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH1 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH1 // Title specifies extra information about an element. Title(v string) HTMLH1 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH1 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH1 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH1 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH1 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH1 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH1 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH1 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH1 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH1 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH1 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH1 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH1 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH1 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH1 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH1 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH1 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH1 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH1 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH1 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH1 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH1 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH1 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH1 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH1 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH1 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH1 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH1 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH1 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH1 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH1 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH1 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH1 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH1 } // H1 returns an HTML element that defines HTML heading. func H1() HTMLH1 { e := &htmlH1{ htmlElement: htmlElement{ tag: "h1", isSelfClosing: false, }, } return e } type htmlH1 struct { htmlElement } func (e *htmlH1) Body(v ...UI) HTMLH1 { e.setChildren(v...) return e } func (e *htmlH1) Text(v any) HTMLH1 { return e.Body(Text(v)) } func (e *htmlH1) AccessKey(v string) HTMLH1 { e.setAttr("accesskey", v) return e } func (e *htmlH1) Aria(k string, v any) HTMLH1 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH1) Attr(n string, v any) HTMLH1 { e.setAttr(n, v) return e } func (e *htmlH1) Class(v ...string) HTMLH1 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH1) ContentEditable(v bool) HTMLH1 { e.setAttr("contenteditable", v) return e } func (e *htmlH1) DataSet(k string, v any) HTMLH1 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH1) Dir(v string) HTMLH1 { e.setAttr("dir", v) return e } func (e *htmlH1) Draggable(v bool) HTMLH1 { e.setAttr("draggable", v) return e } func (e *htmlH1) Hidden(v bool) HTMLH1 { e.setAttr("hidden", v) return e } func (e *htmlH1) ID(v string) HTMLH1 { e.setAttr("id", v) return e } func (e *htmlH1) Lang(v string) HTMLH1 { e.setAttr("lang", v) return e } func (e *htmlH1) Role(v string) HTMLH1 { e.setAttr("role", v) return e } func (e *htmlH1) Spellcheck(v bool) HTMLH1 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH1) Style(k, v string) HTMLH1 { e.setAttr("style", k+":"+v) return e } func (e *htmlH1) Styles(s map[string]string) HTMLH1 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH1) TabIndex(v int) HTMLH1 { e.setAttr("tabindex", v) return e } func (e *htmlH1) Title(v string) HTMLH1 { e.setAttr("title", v) return e } func (e *htmlH1) On(event string, h EventHandler, scope ...any) HTMLH1 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH1) OnBlur(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH1) OnChange(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH1) OnClick(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH1) OnContextMenu(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH1) OnCopy(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH1) OnCut(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH1) OnDblClick(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH1) OnDrag(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH1) OnDragEnd(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH1) OnDragEnter(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH1) OnDragLeave(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH1) OnDragOver(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH1) OnDragStart(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH1) OnDrop(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH1) OnFocus(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH1) OnInput(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH1) OnInvalid(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH1) OnKeyDown(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH1) OnKeyPress(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH1) OnKeyUp(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH1) OnMouseDown(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH1) OnMouseMove(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH1) OnMouseOut(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH1) OnMouseOver(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH1) OnMouseUp(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH1) OnPaste(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH1) OnReset(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH1) OnScroll(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH1) OnSearch(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH1) OnSelect(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH1) OnSubmit(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH1) OnWheel(h EventHandler, scope ...any) HTMLH1 { e.setEventHandler("wheel", h, scope...) return e } // HTMLH2 is the interface that describes a "h2" HTML element. type HTMLH2 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH2 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH2 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH2 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH2 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH2 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH2 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH2 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH2 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH2 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH2 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH2 // ID specifies a unique id for an element. ID(v string) HTMLH2 // Lang specifies the language of the element's content. Lang(v string) HTMLH2 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH2 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH2 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH2 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH2 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH2 // Title specifies extra information about an element. Title(v string) HTMLH2 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH2 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH2 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH2 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH2 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH2 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH2 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH2 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH2 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH2 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH2 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH2 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH2 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH2 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH2 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH2 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH2 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH2 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH2 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH2 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH2 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH2 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH2 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH2 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH2 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH2 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH2 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH2 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH2 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH2 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH2 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH2 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH2 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH2 } // H2 returns an HTML element that defines HTML heading. func H2() HTMLH2 { e := &htmlH2{ htmlElement: htmlElement{ tag: "h2", isSelfClosing: false, }, } return e } type htmlH2 struct { htmlElement } func (e *htmlH2) Body(v ...UI) HTMLH2 { e.setChildren(v...) return e } func (e *htmlH2) Text(v any) HTMLH2 { return e.Body(Text(v)) } func (e *htmlH2) AccessKey(v string) HTMLH2 { e.setAttr("accesskey", v) return e } func (e *htmlH2) Aria(k string, v any) HTMLH2 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH2) Attr(n string, v any) HTMLH2 { e.setAttr(n, v) return e } func (e *htmlH2) Class(v ...string) HTMLH2 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH2) ContentEditable(v bool) HTMLH2 { e.setAttr("contenteditable", v) return e } func (e *htmlH2) DataSet(k string, v any) HTMLH2 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH2) Dir(v string) HTMLH2 { e.setAttr("dir", v) return e } func (e *htmlH2) Draggable(v bool) HTMLH2 { e.setAttr("draggable", v) return e } func (e *htmlH2) Hidden(v bool) HTMLH2 { e.setAttr("hidden", v) return e } func (e *htmlH2) ID(v string) HTMLH2 { e.setAttr("id", v) return e } func (e *htmlH2) Lang(v string) HTMLH2 { e.setAttr("lang", v) return e } func (e *htmlH2) Role(v string) HTMLH2 { e.setAttr("role", v) return e } func (e *htmlH2) Spellcheck(v bool) HTMLH2 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH2) Style(k, v string) HTMLH2 { e.setAttr("style", k+":"+v) return e } func (e *htmlH2) Styles(s map[string]string) HTMLH2 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH2) TabIndex(v int) HTMLH2 { e.setAttr("tabindex", v) return e } func (e *htmlH2) Title(v string) HTMLH2 { e.setAttr("title", v) return e } func (e *htmlH2) On(event string, h EventHandler, scope ...any) HTMLH2 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH2) OnBlur(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH2) OnChange(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH2) OnClick(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH2) OnContextMenu(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH2) OnCopy(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH2) OnCut(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH2) OnDblClick(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH2) OnDrag(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH2) OnDragEnd(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH2) OnDragEnter(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH2) OnDragLeave(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH2) OnDragOver(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH2) OnDragStart(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH2) OnDrop(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH2) OnFocus(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH2) OnInput(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH2) OnInvalid(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH2) OnKeyDown(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH2) OnKeyPress(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH2) OnKeyUp(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH2) OnMouseDown(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH2) OnMouseMove(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH2) OnMouseOut(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH2) OnMouseOver(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH2) OnMouseUp(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH2) OnPaste(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH2) OnReset(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH2) OnScroll(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH2) OnSearch(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH2) OnSelect(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH2) OnSubmit(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH2) OnWheel(h EventHandler, scope ...any) HTMLH2 { e.setEventHandler("wheel", h, scope...) return e } // HTMLH3 is the interface that describes a "h3" HTML element. type HTMLH3 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH3 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH3 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH3 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH3 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH3 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH3 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH3 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH3 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH3 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH3 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH3 // ID specifies a unique id for an element. ID(v string) HTMLH3 // Lang specifies the language of the element's content. Lang(v string) HTMLH3 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH3 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH3 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH3 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH3 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH3 // Title specifies extra information about an element. Title(v string) HTMLH3 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH3 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH3 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH3 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH3 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH3 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH3 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH3 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH3 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH3 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH3 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH3 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH3 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH3 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH3 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH3 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH3 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH3 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH3 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH3 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH3 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH3 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH3 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH3 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH3 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH3 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH3 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH3 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH3 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH3 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH3 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH3 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH3 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH3 } // H3 returns an HTML element that defines HTML heading. func H3() HTMLH3 { e := &htmlH3{ htmlElement: htmlElement{ tag: "h3", isSelfClosing: false, }, } return e } type htmlH3 struct { htmlElement } func (e *htmlH3) Body(v ...UI) HTMLH3 { e.setChildren(v...) return e } func (e *htmlH3) Text(v any) HTMLH3 { return e.Body(Text(v)) } func (e *htmlH3) AccessKey(v string) HTMLH3 { e.setAttr("accesskey", v) return e } func (e *htmlH3) Aria(k string, v any) HTMLH3 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH3) Attr(n string, v any) HTMLH3 { e.setAttr(n, v) return e } func (e *htmlH3) Class(v ...string) HTMLH3 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH3) ContentEditable(v bool) HTMLH3 { e.setAttr("contenteditable", v) return e } func (e *htmlH3) DataSet(k string, v any) HTMLH3 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH3) Dir(v string) HTMLH3 { e.setAttr("dir", v) return e } func (e *htmlH3) Draggable(v bool) HTMLH3 { e.setAttr("draggable", v) return e } func (e *htmlH3) Hidden(v bool) HTMLH3 { e.setAttr("hidden", v) return e } func (e *htmlH3) ID(v string) HTMLH3 { e.setAttr("id", v) return e } func (e *htmlH3) Lang(v string) HTMLH3 { e.setAttr("lang", v) return e } func (e *htmlH3) Role(v string) HTMLH3 { e.setAttr("role", v) return e } func (e *htmlH3) Spellcheck(v bool) HTMLH3 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH3) Style(k, v string) HTMLH3 { e.setAttr("style", k+":"+v) return e } func (e *htmlH3) Styles(s map[string]string) HTMLH3 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH3) TabIndex(v int) HTMLH3 { e.setAttr("tabindex", v) return e } func (e *htmlH3) Title(v string) HTMLH3 { e.setAttr("title", v) return e } func (e *htmlH3) On(event string, h EventHandler, scope ...any) HTMLH3 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH3) OnBlur(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH3) OnChange(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH3) OnClick(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH3) OnContextMenu(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH3) OnCopy(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH3) OnCut(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH3) OnDblClick(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH3) OnDrag(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH3) OnDragEnd(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH3) OnDragEnter(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH3) OnDragLeave(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH3) OnDragOver(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH3) OnDragStart(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH3) OnDrop(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH3) OnFocus(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH3) OnInput(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH3) OnInvalid(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH3) OnKeyDown(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH3) OnKeyPress(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH3) OnKeyUp(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH3) OnMouseDown(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH3) OnMouseMove(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH3) OnMouseOut(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH3) OnMouseOver(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH3) OnMouseUp(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH3) OnPaste(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH3) OnReset(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH3) OnScroll(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH3) OnSearch(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH3) OnSelect(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH3) OnSubmit(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH3) OnWheel(h EventHandler, scope ...any) HTMLH3 { e.setEventHandler("wheel", h, scope...) return e } // HTMLH4 is the interface that describes a "h4" HTML element. type HTMLH4 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH4 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH4 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH4 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH4 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH4 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH4 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH4 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH4 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH4 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH4 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH4 // ID specifies a unique id for an element. ID(v string) HTMLH4 // Lang specifies the language of the element's content. Lang(v string) HTMLH4 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH4 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH4 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH4 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH4 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH4 // Title specifies extra information about an element. Title(v string) HTMLH4 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH4 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH4 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH4 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH4 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH4 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH4 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH4 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH4 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH4 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH4 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH4 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH4 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH4 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH4 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH4 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH4 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH4 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH4 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH4 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH4 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH4 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH4 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH4 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH4 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH4 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH4 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH4 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH4 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH4 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH4 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH4 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH4 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH4 } // H4 returns an HTML element that defines HTML heading. func H4() HTMLH4 { e := &htmlH4{ htmlElement: htmlElement{ tag: "h4", isSelfClosing: false, }, } return e } type htmlH4 struct { htmlElement } func (e *htmlH4) Body(v ...UI) HTMLH4 { e.setChildren(v...) return e } func (e *htmlH4) Text(v any) HTMLH4 { return e.Body(Text(v)) } func (e *htmlH4) AccessKey(v string) HTMLH4 { e.setAttr("accesskey", v) return e } func (e *htmlH4) Aria(k string, v any) HTMLH4 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH4) Attr(n string, v any) HTMLH4 { e.setAttr(n, v) return e } func (e *htmlH4) Class(v ...string) HTMLH4 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH4) ContentEditable(v bool) HTMLH4 { e.setAttr("contenteditable", v) return e } func (e *htmlH4) DataSet(k string, v any) HTMLH4 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH4) Dir(v string) HTMLH4 { e.setAttr("dir", v) return e } func (e *htmlH4) Draggable(v bool) HTMLH4 { e.setAttr("draggable", v) return e } func (e *htmlH4) Hidden(v bool) HTMLH4 { e.setAttr("hidden", v) return e } func (e *htmlH4) ID(v string) HTMLH4 { e.setAttr("id", v) return e } func (e *htmlH4) Lang(v string) HTMLH4 { e.setAttr("lang", v) return e } func (e *htmlH4) Role(v string) HTMLH4 { e.setAttr("role", v) return e } func (e *htmlH4) Spellcheck(v bool) HTMLH4 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH4) Style(k, v string) HTMLH4 { e.setAttr("style", k+":"+v) return e } func (e *htmlH4) Styles(s map[string]string) HTMLH4 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH4) TabIndex(v int) HTMLH4 { e.setAttr("tabindex", v) return e } func (e *htmlH4) Title(v string) HTMLH4 { e.setAttr("title", v) return e } func (e *htmlH4) On(event string, h EventHandler, scope ...any) HTMLH4 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH4) OnBlur(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH4) OnChange(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH4) OnClick(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH4) OnContextMenu(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH4) OnCopy(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH4) OnCut(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH4) OnDblClick(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH4) OnDrag(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH4) OnDragEnd(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH4) OnDragEnter(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH4) OnDragLeave(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH4) OnDragOver(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH4) OnDragStart(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH4) OnDrop(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH4) OnFocus(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH4) OnInput(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH4) OnInvalid(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH4) OnKeyDown(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH4) OnKeyPress(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH4) OnKeyUp(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH4) OnMouseDown(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH4) OnMouseMove(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH4) OnMouseOut(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH4) OnMouseOver(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH4) OnMouseUp(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH4) OnPaste(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH4) OnReset(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH4) OnScroll(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH4) OnSearch(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH4) OnSelect(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH4) OnSubmit(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH4) OnWheel(h EventHandler, scope ...any) HTMLH4 { e.setEventHandler("wheel", h, scope...) return e } // HTMLH5 is the interface that describes a "h5" HTML element. type HTMLH5 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH5 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH5 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH5 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH5 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH5 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH5 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH5 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH5 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH5 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH5 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH5 // ID specifies a unique id for an element. ID(v string) HTMLH5 // Lang specifies the language of the element's content. Lang(v string) HTMLH5 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH5 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH5 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH5 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH5 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH5 // Title specifies extra information about an element. Title(v string) HTMLH5 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH5 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH5 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH5 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH5 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH5 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH5 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH5 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH5 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH5 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH5 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH5 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH5 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH5 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH5 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH5 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH5 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH5 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH5 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH5 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH5 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH5 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH5 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH5 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH5 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH5 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH5 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH5 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH5 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH5 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH5 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH5 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH5 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH5 } // H5 returns an HTML element that defines HTML heading. func H5() HTMLH5 { e := &htmlH5{ htmlElement: htmlElement{ tag: "h5", isSelfClosing: false, }, } return e } type htmlH5 struct { htmlElement } func (e *htmlH5) Body(v ...UI) HTMLH5 { e.setChildren(v...) return e } func (e *htmlH5) Text(v any) HTMLH5 { return e.Body(Text(v)) } func (e *htmlH5) AccessKey(v string) HTMLH5 { e.setAttr("accesskey", v) return e } func (e *htmlH5) Aria(k string, v any) HTMLH5 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH5) Attr(n string, v any) HTMLH5 { e.setAttr(n, v) return e } func (e *htmlH5) Class(v ...string) HTMLH5 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH5) ContentEditable(v bool) HTMLH5 { e.setAttr("contenteditable", v) return e } func (e *htmlH5) DataSet(k string, v any) HTMLH5 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH5) Dir(v string) HTMLH5 { e.setAttr("dir", v) return e } func (e *htmlH5) Draggable(v bool) HTMLH5 { e.setAttr("draggable", v) return e } func (e *htmlH5) Hidden(v bool) HTMLH5 { e.setAttr("hidden", v) return e } func (e *htmlH5) ID(v string) HTMLH5 { e.setAttr("id", v) return e } func (e *htmlH5) Lang(v string) HTMLH5 { e.setAttr("lang", v) return e } func (e *htmlH5) Role(v string) HTMLH5 { e.setAttr("role", v) return e } func (e *htmlH5) Spellcheck(v bool) HTMLH5 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH5) Style(k, v string) HTMLH5 { e.setAttr("style", k+":"+v) return e } func (e *htmlH5) Styles(s map[string]string) HTMLH5 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH5) TabIndex(v int) HTMLH5 { e.setAttr("tabindex", v) return e } func (e *htmlH5) Title(v string) HTMLH5 { e.setAttr("title", v) return e } func (e *htmlH5) On(event string, h EventHandler, scope ...any) HTMLH5 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH5) OnBlur(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH5) OnChange(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH5) OnClick(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH5) OnContextMenu(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH5) OnCopy(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH5) OnCut(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH5) OnDblClick(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH5) OnDrag(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH5) OnDragEnd(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH5) OnDragEnter(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH5) OnDragLeave(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH5) OnDragOver(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH5) OnDragStart(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH5) OnDrop(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH5) OnFocus(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH5) OnInput(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH5) OnInvalid(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH5) OnKeyDown(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH5) OnKeyPress(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH5) OnKeyUp(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH5) OnMouseDown(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH5) OnMouseMove(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH5) OnMouseOut(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH5) OnMouseOver(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH5) OnMouseUp(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH5) OnPaste(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH5) OnReset(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH5) OnScroll(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH5) OnSearch(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH5) OnSelect(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH5) OnSubmit(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH5) OnWheel(h EventHandler, scope ...any) HTMLH5 { e.setEventHandler("wheel", h, scope...) return e } // HTMLH6 is the interface that describes a "h6" HTML element. type HTMLH6 interface { UI // Body set the content of the element. Body(elems ...UI) HTMLH6 // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLH6 // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLH6 // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLH6 // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLH6 // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLH6 // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLH6 // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLH6 // Dir specifies the text direction for the content in an element. Dir(v string) HTMLH6 // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLH6 // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLH6 // ID specifies a unique id for an element. ID(v string) HTMLH6 // Lang specifies the language of the element's content. Lang(v string) HTMLH6 // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLH6 // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLH6 // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLH6 // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLH6 // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLH6 // Title specifies extra information about an element. Title(v string) HTMLH6 // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLH6 // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLH6 // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLH6 // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLH6 // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLH6 // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLH6 // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLH6 // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLH6 // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLH6 // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLH6 // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLH6 // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLH6 // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLH6 // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLH6 // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLH6 // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLH6 // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLH6 // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLH6 // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLH6 // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLH6 // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLH6 // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLH6 // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLH6 // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLH6 // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLH6 // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLH6 // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLH6 // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLH6 // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLH6 // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLH6 // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLH6 // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLH6 // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLH6 } // H6 returns an HTML element that defines HTML heading. func H6() HTMLH6 { e := &htmlH6{ htmlElement: htmlElement{ tag: "h6", isSelfClosing: false, }, } return e } type htmlH6 struct { htmlElement } func (e *htmlH6) Body(v ...UI) HTMLH6 { e.setChildren(v...) return e } func (e *htmlH6) Text(v any) HTMLH6 { return e.Body(Text(v)) } func (e *htmlH6) AccessKey(v string) HTMLH6 { e.setAttr("accesskey", v) return e } func (e *htmlH6) Aria(k string, v any) HTMLH6 { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH6) Attr(n string, v any) HTMLH6 { e.setAttr(n, v) return e } func (e *htmlH6) Class(v ...string) HTMLH6 { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlH6) ContentEditable(v bool) HTMLH6 { e.setAttr("contenteditable", v) return e } func (e *htmlH6) DataSet(k string, v any) HTMLH6 { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlH6) Dir(v string) HTMLH6 { e.setAttr("dir", v) return e } func (e *htmlH6) Draggable(v bool) HTMLH6 { e.setAttr("draggable", v) return e } func (e *htmlH6) Hidden(v bool) HTMLH6 { e.setAttr("hidden", v) return e } func (e *htmlH6) ID(v string) HTMLH6 { e.setAttr("id", v) return e } func (e *htmlH6) Lang(v string) HTMLH6 { e.setAttr("lang", v) return e } func (e *htmlH6) Role(v string) HTMLH6 { e.setAttr("role", v) return e } func (e *htmlH6) Spellcheck(v bool) HTMLH6 { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlH6) Style(k, v string) HTMLH6 { e.setAttr("style", k+":"+v) return e } func (e *htmlH6) Styles(s map[string]string) HTMLH6 { for k, v := range s { e.Style(k, v) } return e } func (e *htmlH6) TabIndex(v int) HTMLH6 { e.setAttr("tabindex", v) return e } func (e *htmlH6) Title(v string) HTMLH6 { e.setAttr("title", v) return e } func (e *htmlH6) On(event string, h EventHandler, scope ...any) HTMLH6 { e.setEventHandler(event, h, scope...) return e } func (e *htmlH6) OnBlur(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("blur", h, scope...) return e } func (e *htmlH6) OnChange(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("change", h, scope...) return e } func (e *htmlH6) OnClick(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("click", h, scope...) return e } func (e *htmlH6) OnContextMenu(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlH6) OnCopy(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("copy", h, scope...) return e } func (e *htmlH6) OnCut(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("cut", h, scope...) return e } func (e *htmlH6) OnDblClick(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlH6) OnDrag(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("drag", h, scope...) return e } func (e *htmlH6) OnDragEnd(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlH6) OnDragEnter(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlH6) OnDragLeave(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlH6) OnDragOver(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlH6) OnDragStart(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlH6) OnDrop(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("drop", h, scope...) return e } func (e *htmlH6) OnFocus(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("focus", h, scope...) return e } func (e *htmlH6) OnInput(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("input", h, scope...) return e } func (e *htmlH6) OnInvalid(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlH6) OnKeyDown(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlH6) OnKeyPress(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlH6) OnKeyUp(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlH6) OnMouseDown(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlH6) OnMouseMove(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlH6) OnMouseOut(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlH6) OnMouseOver(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlH6) OnMouseUp(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlH6) OnPaste(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("paste", h, scope...) return e } func (e *htmlH6) OnReset(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("reset", h, scope...) return e } func (e *htmlH6) OnScroll(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlH6) OnSearch(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("search", h, scope...) return e } func (e *htmlH6) OnSelect(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("select", h, scope...) return e } func (e *htmlH6) OnSubmit(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("submit", h, scope...) return e } func (e *htmlH6) OnWheel(h EventHandler, scope ...any) HTMLH6 { e.setEventHandler("wheel", h, scope...) return e } // HTMLHead is the interface that describes a "head" HTML element. type HTMLHead interface { UI // Body set the content of the element. Body(elems ...UI) HTMLHead // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLHead // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLHead // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLHead // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLHead // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLHead // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLHead // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLHead // Dir specifies the text direction for the content in an element. Dir(v string) HTMLHead // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLHead // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLHead // ID specifies a unique id for an element. ID(v string) HTMLHead // Lang specifies the language of the element's content. Lang(v string) HTMLHead // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLHead // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLHead // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLHead // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLHead // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLHead // Title specifies extra information about an element. Title(v string) HTMLHead // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLHead } // Head returns an HTML element that defines information about the document. func Head() HTMLHead { e := &htmlHead{ htmlElement: htmlElement{ tag: "head", isSelfClosing: false, }, } return e } type htmlHead struct { htmlElement } func (e *htmlHead) Body(v ...UI) HTMLHead { e.setChildren(v...) return e } func (e *htmlHead) Text(v any) HTMLHead { return e.Body(Text(v)) } func (e *htmlHead) AccessKey(v string) HTMLHead { e.setAttr("accesskey", v) return e } func (e *htmlHead) Aria(k string, v any) HTMLHead { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHead) Attr(n string, v any) HTMLHead { e.setAttr(n, v) return e } func (e *htmlHead) Class(v ...string) HTMLHead { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlHead) ContentEditable(v bool) HTMLHead { e.setAttr("contenteditable", v) return e } func (e *htmlHead) DataSet(k string, v any) HTMLHead { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHead) Dir(v string) HTMLHead { e.setAttr("dir", v) return e } func (e *htmlHead) Draggable(v bool) HTMLHead { e.setAttr("draggable", v) return e } func (e *htmlHead) Hidden(v bool) HTMLHead { e.setAttr("hidden", v) return e } func (e *htmlHead) ID(v string) HTMLHead { e.setAttr("id", v) return e } func (e *htmlHead) Lang(v string) HTMLHead { e.setAttr("lang", v) return e } func (e *htmlHead) Role(v string) HTMLHead { e.setAttr("role", v) return e } func (e *htmlHead) Spellcheck(v bool) HTMLHead { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlHead) Style(k, v string) HTMLHead { e.setAttr("style", k+":"+v) return e } func (e *htmlHead) Styles(s map[string]string) HTMLHead { for k, v := range s { e.Style(k, v) } return e } func (e *htmlHead) TabIndex(v int) HTMLHead { e.setAttr("tabindex", v) return e } func (e *htmlHead) Title(v string) HTMLHead { e.setAttr("title", v) return e } func (e *htmlHead) On(event string, h EventHandler, scope ...any) HTMLHead { e.setEventHandler(event, h, scope...) return e } // HTMLHeader is the interface that describes a "header" HTML element. type HTMLHeader interface { UI // Body set the content of the element. Body(elems ...UI) HTMLHeader // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLHeader // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLHeader // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLHeader // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLHeader // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLHeader // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLHeader // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLHeader // Dir specifies the text direction for the content in an element. Dir(v string) HTMLHeader // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLHeader // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLHeader // ID specifies a unique id for an element. ID(v string) HTMLHeader // Lang specifies the language of the element's content. Lang(v string) HTMLHeader // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLHeader // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLHeader // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLHeader // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLHeader // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLHeader // Title specifies extra information about an element. Title(v string) HTMLHeader // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLHeader // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLHeader // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLHeader // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLHeader // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLHeader // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLHeader // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLHeader // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLHeader // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLHeader // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLHeader // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLHeader // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLHeader // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLHeader // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLHeader // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLHeader // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLHeader // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLHeader // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLHeader // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLHeader // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLHeader // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLHeader // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLHeader // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLHeader // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLHeader // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLHeader // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLHeader // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLHeader // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLHeader // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLHeader // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLHeader // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLHeader // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLHeader // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLHeader } // Header returns an HTML element that defines a header for a document or section. func Header() HTMLHeader { e := &htmlHeader{ htmlElement: htmlElement{ tag: "header", isSelfClosing: false, }, } return e } type htmlHeader struct { htmlElement } func (e *htmlHeader) Body(v ...UI) HTMLHeader { e.setChildren(v...) return e } func (e *htmlHeader) Text(v any) HTMLHeader { return e.Body(Text(v)) } func (e *htmlHeader) AccessKey(v string) HTMLHeader { e.setAttr("accesskey", v) return e } func (e *htmlHeader) Aria(k string, v any) HTMLHeader { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHeader) Attr(n string, v any) HTMLHeader { e.setAttr(n, v) return e } func (e *htmlHeader) Class(v ...string) HTMLHeader { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlHeader) ContentEditable(v bool) HTMLHeader { e.setAttr("contenteditable", v) return e } func (e *htmlHeader) DataSet(k string, v any) HTMLHeader { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHeader) Dir(v string) HTMLHeader { e.setAttr("dir", v) return e } func (e *htmlHeader) Draggable(v bool) HTMLHeader { e.setAttr("draggable", v) return e } func (e *htmlHeader) Hidden(v bool) HTMLHeader { e.setAttr("hidden", v) return e } func (e *htmlHeader) ID(v string) HTMLHeader { e.setAttr("id", v) return e } func (e *htmlHeader) Lang(v string) HTMLHeader { e.setAttr("lang", v) return e } func (e *htmlHeader) Role(v string) HTMLHeader { e.setAttr("role", v) return e } func (e *htmlHeader) Spellcheck(v bool) HTMLHeader { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlHeader) Style(k, v string) HTMLHeader { e.setAttr("style", k+":"+v) return e } func (e *htmlHeader) Styles(s map[string]string) HTMLHeader { for k, v := range s { e.Style(k, v) } return e } func (e *htmlHeader) TabIndex(v int) HTMLHeader { e.setAttr("tabindex", v) return e } func (e *htmlHeader) Title(v string) HTMLHeader { e.setAttr("title", v) return e } func (e *htmlHeader) On(event string, h EventHandler, scope ...any) HTMLHeader { e.setEventHandler(event, h, scope...) return e } func (e *htmlHeader) OnBlur(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("blur", h, scope...) return e } func (e *htmlHeader) OnChange(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("change", h, scope...) return e } func (e *htmlHeader) OnClick(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("click", h, scope...) return e } func (e *htmlHeader) OnContextMenu(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlHeader) OnCopy(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("copy", h, scope...) return e } func (e *htmlHeader) OnCut(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("cut", h, scope...) return e } func (e *htmlHeader) OnDblClick(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlHeader) OnDrag(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("drag", h, scope...) return e } func (e *htmlHeader) OnDragEnd(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlHeader) OnDragEnter(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlHeader) OnDragLeave(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlHeader) OnDragOver(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlHeader) OnDragStart(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlHeader) OnDrop(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("drop", h, scope...) return e } func (e *htmlHeader) OnFocus(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("focus", h, scope...) return e } func (e *htmlHeader) OnInput(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("input", h, scope...) return e } func (e *htmlHeader) OnInvalid(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlHeader) OnKeyDown(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlHeader) OnKeyPress(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlHeader) OnKeyUp(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlHeader) OnMouseDown(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlHeader) OnMouseMove(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlHeader) OnMouseOut(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlHeader) OnMouseOver(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlHeader) OnMouseUp(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlHeader) OnPaste(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("paste", h, scope...) return e } func (e *htmlHeader) OnReset(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("reset", h, scope...) return e } func (e *htmlHeader) OnScroll(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlHeader) OnSearch(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("search", h, scope...) return e } func (e *htmlHeader) OnSelect(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("select", h, scope...) return e } func (e *htmlHeader) OnSubmit(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("submit", h, scope...) return e } func (e *htmlHeader) OnWheel(h EventHandler, scope ...any) HTMLHeader { e.setEventHandler("wheel", h, scope...) return e } // HTMLHr is the interface that describes a "hr" HTML element. type HTMLHr interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLHr // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLHr // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLHr // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLHr // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLHr // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLHr // Dir specifies the text direction for the content in an element. Dir(v string) HTMLHr // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLHr // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLHr // ID specifies a unique id for an element. ID(v string) HTMLHr // Lang specifies the language of the element's content. Lang(v string) HTMLHr // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLHr // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLHr // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLHr // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLHr // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLHr // Title specifies extra information about an element. Title(v string) HTMLHr // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLHr // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLHr // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLHr // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLHr // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLHr // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLHr // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLHr // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLHr // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLHr // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLHr // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLHr // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLHr // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLHr // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLHr // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLHr // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLHr // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLHr // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLHr // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLHr // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLHr // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLHr // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLHr // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLHr // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLHr // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLHr // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLHr // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLHr // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLHr // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLHr // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLHr // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLHr // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLHr // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLHr } // Hr returns an HTML element that defines a thematic change in the content. func Hr() HTMLHr { e := &htmlHr{ htmlElement: htmlElement{ tag: "hr", isSelfClosing: true, }, } return e } type htmlHr struct { htmlElement } func (e *htmlHr) AccessKey(v string) HTMLHr { e.setAttr("accesskey", v) return e } func (e *htmlHr) Aria(k string, v any) HTMLHr { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHr) Attr(n string, v any) HTMLHr { e.setAttr(n, v) return e } func (e *htmlHr) Class(v ...string) HTMLHr { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlHr) ContentEditable(v bool) HTMLHr { e.setAttr("contenteditable", v) return e } func (e *htmlHr) DataSet(k string, v any) HTMLHr { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHr) Dir(v string) HTMLHr { e.setAttr("dir", v) return e } func (e *htmlHr) Draggable(v bool) HTMLHr { e.setAttr("draggable", v) return e } func (e *htmlHr) Hidden(v bool) HTMLHr { e.setAttr("hidden", v) return e } func (e *htmlHr) ID(v string) HTMLHr { e.setAttr("id", v) return e } func (e *htmlHr) Lang(v string) HTMLHr { e.setAttr("lang", v) return e } func (e *htmlHr) Role(v string) HTMLHr { e.setAttr("role", v) return e } func (e *htmlHr) Spellcheck(v bool) HTMLHr { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlHr) Style(k, v string) HTMLHr { e.setAttr("style", k+":"+v) return e } func (e *htmlHr) Styles(s map[string]string) HTMLHr { for k, v := range s { e.Style(k, v) } return e } func (e *htmlHr) TabIndex(v int) HTMLHr { e.setAttr("tabindex", v) return e } func (e *htmlHr) Title(v string) HTMLHr { e.setAttr("title", v) return e } func (e *htmlHr) On(event string, h EventHandler, scope ...any) HTMLHr { e.setEventHandler(event, h, scope...) return e } func (e *htmlHr) OnBlur(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("blur", h, scope...) return e } func (e *htmlHr) OnChange(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("change", h, scope...) return e } func (e *htmlHr) OnClick(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("click", h, scope...) return e } func (e *htmlHr) OnContextMenu(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlHr) OnCopy(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("copy", h, scope...) return e } func (e *htmlHr) OnCut(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("cut", h, scope...) return e } func (e *htmlHr) OnDblClick(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlHr) OnDrag(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("drag", h, scope...) return e } func (e *htmlHr) OnDragEnd(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlHr) OnDragEnter(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlHr) OnDragLeave(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlHr) OnDragOver(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlHr) OnDragStart(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlHr) OnDrop(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("drop", h, scope...) return e } func (e *htmlHr) OnFocus(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("focus", h, scope...) return e } func (e *htmlHr) OnInput(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("input", h, scope...) return e } func (e *htmlHr) OnInvalid(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlHr) OnKeyDown(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlHr) OnKeyPress(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlHr) OnKeyUp(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlHr) OnMouseDown(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlHr) OnMouseMove(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlHr) OnMouseOut(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlHr) OnMouseOver(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlHr) OnMouseUp(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlHr) OnPaste(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("paste", h, scope...) return e } func (e *htmlHr) OnReset(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("reset", h, scope...) return e } func (e *htmlHr) OnScroll(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlHr) OnSearch(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("search", h, scope...) return e } func (e *htmlHr) OnSelect(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("select", h, scope...) return e } func (e *htmlHr) OnSubmit(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("submit", h, scope...) return e } func (e *htmlHr) OnWheel(h EventHandler, scope ...any) HTMLHr { e.setEventHandler("wheel", h, scope...) return e } // HTMLHtml is the interface that describes a "html" HTML element. type HTMLHtml interface { UI privateBody(elems ...UI) HTMLHtml // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLHtml // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLHtml // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLHtml // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLHtml // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLHtml // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLHtml // Dir specifies the text direction for the content in an element. Dir(v string) HTMLHtml // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLHtml // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLHtml // ID specifies a unique id for an element. ID(v string) HTMLHtml // Lang specifies the language of the element's content. Lang(v string) HTMLHtml // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLHtml // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLHtml // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLHtml // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLHtml // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLHtml // Title specifies extra information about an element. Title(v string) HTMLHtml // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLHtml } // Html returns an HTML element that defines the root of an HTML document. func Html() HTMLHtml { e := &htmlHtml{ htmlElement: htmlElement{ tag: "html", isSelfClosing: false, }, } return e } type htmlHtml struct { htmlElement } func (e *htmlHtml) privateBody(v ...UI) HTMLHtml { e.setChildren(v...) return e } func (e *htmlHtml) AccessKey(v string) HTMLHtml { e.setAttr("accesskey", v) return e } func (e *htmlHtml) Aria(k string, v any) HTMLHtml { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHtml) Attr(n string, v any) HTMLHtml { e.setAttr(n, v) return e } func (e *htmlHtml) Class(v ...string) HTMLHtml { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlHtml) ContentEditable(v bool) HTMLHtml { e.setAttr("contenteditable", v) return e } func (e *htmlHtml) DataSet(k string, v any) HTMLHtml { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlHtml) Dir(v string) HTMLHtml { e.setAttr("dir", v) return e } func (e *htmlHtml) Draggable(v bool) HTMLHtml { e.setAttr("draggable", v) return e } func (e *htmlHtml) Hidden(v bool) HTMLHtml { e.setAttr("hidden", v) return e } func (e *htmlHtml) ID(v string) HTMLHtml { e.setAttr("id", v) return e } func (e *htmlHtml) Lang(v string) HTMLHtml { e.setAttr("lang", v) return e } func (e *htmlHtml) Role(v string) HTMLHtml { e.setAttr("role", v) return e } func (e *htmlHtml) Spellcheck(v bool) HTMLHtml { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlHtml) Style(k, v string) HTMLHtml { e.setAttr("style", k+":"+v) return e } func (e *htmlHtml) Styles(s map[string]string) HTMLHtml { for k, v := range s { e.Style(k, v) } return e } func (e *htmlHtml) TabIndex(v int) HTMLHtml { e.setAttr("tabindex", v) return e } func (e *htmlHtml) Title(v string) HTMLHtml { e.setAttr("title", v) return e } func (e *htmlHtml) On(event string, h EventHandler, scope ...any) HTMLHtml { e.setEventHandler(event, h, scope...) return e } // HTMLI is the interface that describes a "i" HTML element. type HTMLI interface { UI // Body set the content of the element. Body(elems ...UI) HTMLI // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLI // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLI // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLI // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLI // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLI // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLI // Dir specifies the text direction for the content in an element. Dir(v string) HTMLI // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLI // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLI // ID specifies a unique id for an element. ID(v string) HTMLI // Lang specifies the language of the element's content. Lang(v string) HTMLI // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLI // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLI // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLI // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLI // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLI // Title specifies extra information about an element. Title(v string) HTMLI // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLI // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLI // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLI // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLI // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLI // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLI // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLI // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLI // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLI // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLI // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLI // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLI // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLI // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLI // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLI // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLI // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLI // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLI // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLI // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLI // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLI // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLI // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLI // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLI // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLI // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLI // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLI // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLI // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLI // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLI // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLI // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLI // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLI } // I returns an HTML element that defines a part of text in an alternate voice or mood. func I() HTMLI { e := &htmlI{ htmlElement: htmlElement{ tag: "i", isSelfClosing: false, }, } return e } type htmlI struct { htmlElement } func (e *htmlI) Body(v ...UI) HTMLI { e.setChildren(v...) return e } func (e *htmlI) Text(v any) HTMLI { return e.Body(Text(v)) } func (e *htmlI) AccessKey(v string) HTMLI { e.setAttr("accesskey", v) return e } func (e *htmlI) Aria(k string, v any) HTMLI { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlI) Attr(n string, v any) HTMLI { e.setAttr(n, v) return e } func (e *htmlI) Class(v ...string) HTMLI { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlI) ContentEditable(v bool) HTMLI { e.setAttr("contenteditable", v) return e } func (e *htmlI) DataSet(k string, v any) HTMLI { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlI) Dir(v string) HTMLI { e.setAttr("dir", v) return e } func (e *htmlI) Draggable(v bool) HTMLI { e.setAttr("draggable", v) return e } func (e *htmlI) Hidden(v bool) HTMLI { e.setAttr("hidden", v) return e } func (e *htmlI) ID(v string) HTMLI { e.setAttr("id", v) return e } func (e *htmlI) Lang(v string) HTMLI { e.setAttr("lang", v) return e } func (e *htmlI) Role(v string) HTMLI { e.setAttr("role", v) return e } func (e *htmlI) Spellcheck(v bool) HTMLI { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlI) Style(k, v string) HTMLI { e.setAttr("style", k+":"+v) return e } func (e *htmlI) Styles(s map[string]string) HTMLI { for k, v := range s { e.Style(k, v) } return e } func (e *htmlI) TabIndex(v int) HTMLI { e.setAttr("tabindex", v) return e } func (e *htmlI) Title(v string) HTMLI { e.setAttr("title", v) return e } func (e *htmlI) On(event string, h EventHandler, scope ...any) HTMLI { e.setEventHandler(event, h, scope...) return e } func (e *htmlI) OnBlur(h EventHandler, scope ...any) HTMLI { e.setEventHandler("blur", h, scope...) return e } func (e *htmlI) OnChange(h EventHandler, scope ...any) HTMLI { e.setEventHandler("change", h, scope...) return e } func (e *htmlI) OnClick(h EventHandler, scope ...any) HTMLI { e.setEventHandler("click", h, scope...) return e } func (e *htmlI) OnContextMenu(h EventHandler, scope ...any) HTMLI { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlI) OnCopy(h EventHandler, scope ...any) HTMLI { e.setEventHandler("copy", h, scope...) return e } func (e *htmlI) OnCut(h EventHandler, scope ...any) HTMLI { e.setEventHandler("cut", h, scope...) return e } func (e *htmlI) OnDblClick(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlI) OnDrag(h EventHandler, scope ...any) HTMLI { e.setEventHandler("drag", h, scope...) return e } func (e *htmlI) OnDragEnd(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlI) OnDragEnter(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlI) OnDragLeave(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlI) OnDragOver(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlI) OnDragStart(h EventHandler, scope ...any) HTMLI { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlI) OnDrop(h EventHandler, scope ...any) HTMLI { e.setEventHandler("drop", h, scope...) return e } func (e *htmlI) OnFocus(h EventHandler, scope ...any) HTMLI { e.setEventHandler("focus", h, scope...) return e } func (e *htmlI) OnInput(h EventHandler, scope ...any) HTMLI { e.setEventHandler("input", h, scope...) return e } func (e *htmlI) OnInvalid(h EventHandler, scope ...any) HTMLI { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlI) OnKeyDown(h EventHandler, scope ...any) HTMLI { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlI) OnKeyPress(h EventHandler, scope ...any) HTMLI { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlI) OnKeyUp(h EventHandler, scope ...any) HTMLI { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlI) OnMouseDown(h EventHandler, scope ...any) HTMLI { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlI) OnMouseMove(h EventHandler, scope ...any) HTMLI { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlI) OnMouseOut(h EventHandler, scope ...any) HTMLI { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlI) OnMouseOver(h EventHandler, scope ...any) HTMLI { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlI) OnMouseUp(h EventHandler, scope ...any) HTMLI { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlI) OnPaste(h EventHandler, scope ...any) HTMLI { e.setEventHandler("paste", h, scope...) return e } func (e *htmlI) OnReset(h EventHandler, scope ...any) HTMLI { e.setEventHandler("reset", h, scope...) return e } func (e *htmlI) OnScroll(h EventHandler, scope ...any) HTMLI { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlI) OnSearch(h EventHandler, scope ...any) HTMLI { e.setEventHandler("search", h, scope...) return e } func (e *htmlI) OnSelect(h EventHandler, scope ...any) HTMLI { e.setEventHandler("select", h, scope...) return e } func (e *htmlI) OnSubmit(h EventHandler, scope ...any) HTMLI { e.setEventHandler("submit", h, scope...) return e } func (e *htmlI) OnWheel(h EventHandler, scope ...any) HTMLI { e.setEventHandler("wheel", h, scope...) return e } // HTMLIFrame is the interface that describes a "iframe" HTML element. type HTMLIFrame interface { UI // Body set the content of the element. Body(elems ...UI) HTMLIFrame // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLIFrame // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLIFrame // Allow specifies a feature policy. Can be called multiple times to set multiple policies. Allow(v string) HTMLIFrame // AllowFullscreen reports whether an iframe can activate fullscreen mode. AllowFullscreen(v bool) HTMLIFrame // AllowPaymentRequest reports whether an iframe should be allowed to invoke the Payment Request API AllowPaymentRequest(v bool) HTMLIFrame // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLIFrame // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLIFrame // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLIFrame // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLIFrame // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLIFrame // Dir specifies the text direction for the content in an element. Dir(v string) HTMLIFrame // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLIFrame // Height specifies the height of the element (in pixels). Height(v int) HTMLIFrame // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLIFrame // ID specifies a unique id for an element. ID(v string) HTMLIFrame // Lang specifies the language of the element's content. Lang(v string) HTMLIFrame // Loading indicates how the browser should load the iframe (eager|lazy). Loading(v string) HTMLIFrame // Name specifies the name of the element. Name(v string) HTMLIFrame // ReferrerPolicy specifies how much/which referrer information that will be sent when processing the iframe attributes ReferrerPolicy(v string) HTMLIFrame // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLIFrame // Sandbox enables an extra set of restrictions for the content in an iframe. Sandbox(v any) HTMLIFrame // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLIFrame // Src specifies the URL of the media file. Src(v string) HTMLIFrame // SrcDoc specifies the HTML content of the page to show in the iframe. SrcDoc(v string) HTMLIFrame // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLIFrame // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLIFrame // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLIFrame // Title specifies extra information about an element. Title(v string) HTMLIFrame // Width specifies the width of the element. Width(v int) HTMLIFrame // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLIFrame // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLIFrame // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLIFrame // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLIFrame // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLIFrame // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLIFrame // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLIFrame // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLIFrame // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLIFrame // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLIFrame // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLIFrame // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLIFrame // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLIFrame // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLIFrame // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLIFrame // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLIFrame // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLIFrame // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLIFrame // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLIFrame // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLIFrame // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLIFrame // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLIFrame // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLIFrame // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLIFrame // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLIFrame // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLIFrame // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLIFrame // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLIFrame // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLIFrame // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLIFrame // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLIFrame // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLIFrame // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLIFrame // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLIFrame } // IFrame returns an HTML element that defines an inline frame. func IFrame() HTMLIFrame { e := &htmlIFrame{ htmlElement: htmlElement{ tag: "iframe", isSelfClosing: false, }, } return e } type htmlIFrame struct { htmlElement } func (e *htmlIFrame) Body(v ...UI) HTMLIFrame { e.setChildren(v...) return e } func (e *htmlIFrame) Text(v any) HTMLIFrame { return e.Body(Text(v)) } func (e *htmlIFrame) AccessKey(v string) HTMLIFrame { e.setAttr("accesskey", v) return e } func (e *htmlIFrame) Allow(v string) HTMLIFrame { e.setAttr("allow", v) return e } func (e *htmlIFrame) AllowFullscreen(v bool) HTMLIFrame { s := "false" if v { s = "true" } e.setAttr("allowfullscreen", s) return e } func (e *htmlIFrame) AllowPaymentRequest(v bool) HTMLIFrame { s := "false" if v { s = "true" } e.setAttr("allowpaymentrequest", s) return e } func (e *htmlIFrame) Aria(k string, v any) HTMLIFrame { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlIFrame) Attr(n string, v any) HTMLIFrame { e.setAttr(n, v) return e } func (e *htmlIFrame) Class(v ...string) HTMLIFrame { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlIFrame) ContentEditable(v bool) HTMLIFrame { e.setAttr("contenteditable", v) return e } func (e *htmlIFrame) DataSet(k string, v any) HTMLIFrame { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlIFrame) Dir(v string) HTMLIFrame { e.setAttr("dir", v) return e } func (e *htmlIFrame) Draggable(v bool) HTMLIFrame { e.setAttr("draggable", v) return e } func (e *htmlIFrame) Height(v int) HTMLIFrame { e.setAttr("height", v) return e } func (e *htmlIFrame) Hidden(v bool) HTMLIFrame { e.setAttr("hidden", v) return e } func (e *htmlIFrame) ID(v string) HTMLIFrame { e.setAttr("id", v) return e } func (e *htmlIFrame) Lang(v string) HTMLIFrame { e.setAttr("lang", v) return e } func (e *htmlIFrame) Loading(v string) HTMLIFrame { e.setAttr("loading", v) return e } func (e *htmlIFrame) Name(v string) HTMLIFrame { e.setAttr("name", v) return e } func (e *htmlIFrame) ReferrerPolicy(v string) HTMLIFrame { e.setAttr("referrerpolicy", v) return e } func (e *htmlIFrame) Role(v string) HTMLIFrame { e.setAttr("role", v) return e } func (e *htmlIFrame) Sandbox(v any) HTMLIFrame { e.setAttr("sandbox", v) return e } func (e *htmlIFrame) Spellcheck(v bool) HTMLIFrame { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlIFrame) Src(v string) HTMLIFrame { e.setAttr("src", v) return e } func (e *htmlIFrame) SrcDoc(v string) HTMLIFrame { e.setAttr("srcdoc", v) return e } func (e *htmlIFrame) Style(k, v string) HTMLIFrame { e.setAttr("style", k+":"+v) return e } func (e *htmlIFrame) Styles(s map[string]string) HTMLIFrame { for k, v := range s { e.Style(k, v) } return e } func (e *htmlIFrame) TabIndex(v int) HTMLIFrame { e.setAttr("tabindex", v) return e } func (e *htmlIFrame) Title(v string) HTMLIFrame { e.setAttr("title", v) return e } func (e *htmlIFrame) Width(v int) HTMLIFrame { e.setAttr("width", v) return e } func (e *htmlIFrame) On(event string, h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler(event, h, scope...) return e } func (e *htmlIFrame) OnBlur(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("blur", h, scope...) return e } func (e *htmlIFrame) OnChange(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("change", h, scope...) return e } func (e *htmlIFrame) OnClick(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("click", h, scope...) return e } func (e *htmlIFrame) OnContextMenu(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlIFrame) OnCopy(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("copy", h, scope...) return e } func (e *htmlIFrame) OnCut(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("cut", h, scope...) return e } func (e *htmlIFrame) OnDblClick(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlIFrame) OnDrag(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("drag", h, scope...) return e } func (e *htmlIFrame) OnDragEnd(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlIFrame) OnDragEnter(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlIFrame) OnDragLeave(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlIFrame) OnDragOver(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlIFrame) OnDragStart(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlIFrame) OnDrop(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("drop", h, scope...) return e } func (e *htmlIFrame) OnFocus(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("focus", h, scope...) return e } func (e *htmlIFrame) OnInput(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("input", h, scope...) return e } func (e *htmlIFrame) OnInvalid(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlIFrame) OnKeyDown(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlIFrame) OnKeyPress(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlIFrame) OnKeyUp(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlIFrame) OnLoad(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("load", h, scope...) return e } func (e *htmlIFrame) OnMouseDown(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlIFrame) OnMouseMove(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlIFrame) OnMouseOut(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlIFrame) OnMouseOver(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlIFrame) OnMouseUp(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlIFrame) OnPaste(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("paste", h, scope...) return e } func (e *htmlIFrame) OnReset(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("reset", h, scope...) return e } func (e *htmlIFrame) OnScroll(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlIFrame) OnSearch(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("search", h, scope...) return e } func (e *htmlIFrame) OnSelect(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("select", h, scope...) return e } func (e *htmlIFrame) OnSubmit(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("submit", h, scope...) return e } func (e *htmlIFrame) OnWheel(h EventHandler, scope ...any) HTMLIFrame { e.setEventHandler("wheel", h, scope...) return e } // HTMLImg is the interface that describes a "img" HTML element. type HTMLImg interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLImg // Alt specifies an alternate text when the original element fails to display. Alt(v string) HTMLImg // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLImg // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLImg // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLImg // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLImg // CrossOrigin sets the mode of the request to an HTTP CORS Request. CrossOrigin(v string) HTMLImg // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLImg // Dir specifies the text direction for the content in an element. Dir(v string) HTMLImg // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLImg // Height specifies the height of the element (in pixels). Height(v int) HTMLImg // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLImg // ID specifies a unique id for an element. ID(v string) HTMLImg // IsMap specifies an image as a server-side image-map. IsMap(v bool) HTMLImg // Lang specifies the language of the element's content. Lang(v string) HTMLImg // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLImg // Sizes specifies the size of the linked resource. Sizes(v string) HTMLImg // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLImg // Src specifies the URL of the media file. Src(v string) HTMLImg // SrcSet specifies the URL of the image to use in different situations. SrcSet(v string) HTMLImg // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLImg // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLImg // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLImg // Title specifies extra information about an element. Title(v string) HTMLImg // UseMap specifies an image as a client-side image-map. UseMap(v string) HTMLImg // Width specifies the width of the element. Width(v int) HTMLImg // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLImg // OnAbort calls the given handler on abort. OnAbort(h EventHandler, scope ...any) HTMLImg // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLImg // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin). OnCanPlay(h EventHandler, scope ...any) HTMLImg // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering. OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLImg // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLImg // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLImg // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLImg // OnCueChange calls the given handler when the cue changes in a track element. OnCueChange(h EventHandler, scope ...any) HTMLImg // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLImg // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLImg // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLImg // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLImg // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLImg // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLImg // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLImg // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLImg // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLImg // OnDurationChange calls the given handler when the length of the media changes. OnDurationChange(h EventHandler, scope ...any) HTMLImg // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects). OnEmptied(h EventHandler, scope ...any) HTMLImg // OnEnded calls the given handler when the media has reach the end. OnEnded(h EventHandler, scope ...any) HTMLImg // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLImg // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLImg // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLImg // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLImg // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLImg // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLImg // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLImg // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLImg // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded. OnLoadStart(h EventHandler, scope ...any) HTMLImg // OnLoadedData calls the given handler when media data is loaded. OnLoadedData(h EventHandler, scope ...any) HTMLImg // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded. OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLImg // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLImg // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLImg // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLImg // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLImg // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLImg // OnPause calls the given handler when the media is paused either by the user or programmatically. OnPause(h EventHandler, scope ...any) HTMLImg // OnPlay calls the given handler when the media is ready to start playing. OnPlay(h EventHandler, scope ...any) HTMLImg // OnPlaying calls the given handler when the media actually has started playing. OnPlaying(h EventHandler, scope ...any) HTMLImg // OnProgress calls the given handler when the browser is in the process of getting the media data. OnProgress(h EventHandler, scope ...any) HTMLImg // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). OnRateChange(h EventHandler, scope ...any) HTMLImg // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLImg // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLImg // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLImg // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended. OnSeeked(h EventHandler, scope ...any) HTMLImg // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active. OnSeeking(h EventHandler, scope ...any) HTMLImg // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLImg // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason. OnStalled(h EventHandler, scope ...any) HTMLImg // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLImg // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason. OnSuspend(h EventHandler, scope ...any) HTMLImg // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media). OnTimeUpdate(h EventHandler, scope ...any) HTMLImg // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute"). OnVolumeChange(h EventHandler, scope ...any) HTMLImg // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data). OnWaiting(h EventHandler, scope ...any) HTMLImg // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLImg } // Img returns an HTML element that defines an image. func Img() HTMLImg { e := &htmlImg{ htmlElement: htmlElement{ tag: "img", isSelfClosing: true, }, } return e } type htmlImg struct { htmlElement } func (e *htmlImg) AccessKey(v string) HTMLImg { e.setAttr("accesskey", v) return e } func (e *htmlImg) Alt(v string) HTMLImg { e.setAttr("alt", v) return e } func (e *htmlImg) Aria(k string, v any) HTMLImg { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlImg) Attr(n string, v any) HTMLImg { e.setAttr(n, v) return e } func (e *htmlImg) Class(v ...string) HTMLImg { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlImg) ContentEditable(v bool) HTMLImg { e.setAttr("contenteditable", v) return e } func (e *htmlImg) CrossOrigin(v string) HTMLImg { e.setAttr("crossorigin", v) return e } func (e *htmlImg) DataSet(k string, v any) HTMLImg { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlImg) Dir(v string) HTMLImg { e.setAttr("dir", v) return e } func (e *htmlImg) Draggable(v bool) HTMLImg { e.setAttr("draggable", v) return e } func (e *htmlImg) Height(v int) HTMLImg { e.setAttr("height", v) return e } func (e *htmlImg) Hidden(v bool) HTMLImg { e.setAttr("hidden", v) return e } func (e *htmlImg) ID(v string) HTMLImg { e.setAttr("id", v) return e } func (e *htmlImg) IsMap(v bool) HTMLImg { e.setAttr("ismap", v) return e } func (e *htmlImg) Lang(v string) HTMLImg { e.setAttr("lang", v) return e } func (e *htmlImg) Role(v string) HTMLImg { e.setAttr("role", v) return e } func (e *htmlImg) Sizes(v string) HTMLImg { e.setAttr("sizes", v) return e } func (e *htmlImg) Spellcheck(v bool) HTMLImg { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlImg) Src(v string) HTMLImg { e.setAttr("src", v) return e } func (e *htmlImg) SrcSet(v string) HTMLImg { e.setAttr("srcset", v) return e } func (e *htmlImg) Style(k, v string) HTMLImg { e.setAttr("style", k+":"+v) return e } func (e *htmlImg) Styles(s map[string]string) HTMLImg { for k, v := range s { e.Style(k, v) } return e } func (e *htmlImg) TabIndex(v int) HTMLImg { e.setAttr("tabindex", v) return e } func (e *htmlImg) Title(v string) HTMLImg { e.setAttr("title", v) return e } func (e *htmlImg) UseMap(v string) HTMLImg { e.setAttr("usemap", v) return e } func (e *htmlImg) Width(v int) HTMLImg { e.setAttr("width", v) return e } func (e *htmlImg) On(event string, h EventHandler, scope ...any) HTMLImg { e.setEventHandler(event, h, scope...) return e } func (e *htmlImg) OnAbort(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("abort", h, scope...) return e } func (e *htmlImg) OnBlur(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("blur", h, scope...) return e } func (e *htmlImg) OnCanPlay(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("canplay", h, scope...) return e } func (e *htmlImg) OnCanPlayThrough(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("canplaythrough", h, scope...) return e } func (e *htmlImg) OnChange(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("change", h, scope...) return e } func (e *htmlImg) OnClick(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("click", h, scope...) return e } func (e *htmlImg) OnContextMenu(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlImg) OnCopy(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("copy", h, scope...) return e } func (e *htmlImg) OnCueChange(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("cuechange", h, scope...) return e } func (e *htmlImg) OnCut(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("cut", h, scope...) return e } func (e *htmlImg) OnDblClick(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlImg) OnDrag(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("drag", h, scope...) return e } func (e *htmlImg) OnDragEnd(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlImg) OnDragEnter(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlImg) OnDragLeave(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlImg) OnDragOver(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlImg) OnDragStart(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlImg) OnDrop(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("drop", h, scope...) return e } func (e *htmlImg) OnDurationChange(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("durationchange", h, scope...) return e } func (e *htmlImg) OnEmptied(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("emptied", h, scope...) return e } func (e *htmlImg) OnEnded(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("ended", h, scope...) return e } func (e *htmlImg) OnError(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("error", h, scope...) return e } func (e *htmlImg) OnFocus(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("focus", h, scope...) return e } func (e *htmlImg) OnInput(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("input", h, scope...) return e } func (e *htmlImg) OnInvalid(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlImg) OnKeyDown(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlImg) OnKeyPress(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlImg) OnKeyUp(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlImg) OnLoad(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("load", h, scope...) return e } func (e *htmlImg) OnLoadStart(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("loadstart", h, scope...) return e } func (e *htmlImg) OnLoadedData(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("loadeddata", h, scope...) return e } func (e *htmlImg) OnLoadedMetaData(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("loadedmetadata", h, scope...) return e } func (e *htmlImg) OnMouseDown(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlImg) OnMouseMove(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlImg) OnMouseOut(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlImg) OnMouseOver(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlImg) OnMouseUp(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlImg) OnPaste(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("paste", h, scope...) return e } func (e *htmlImg) OnPause(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("pause", h, scope...) return e } func (e *htmlImg) OnPlay(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("play", h, scope...) return e } func (e *htmlImg) OnPlaying(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("playing", h, scope...) return e } func (e *htmlImg) OnProgress(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("progress", h, scope...) return e } func (e *htmlImg) OnRateChange(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("ratechange", h, scope...) return e } func (e *htmlImg) OnReset(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("reset", h, scope...) return e } func (e *htmlImg) OnScroll(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlImg) OnSearch(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("search", h, scope...) return e } func (e *htmlImg) OnSeeked(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("seeked", h, scope...) return e } func (e *htmlImg) OnSeeking(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("seeking", h, scope...) return e } func (e *htmlImg) OnSelect(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("select", h, scope...) return e } func (e *htmlImg) OnStalled(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("stalled", h, scope...) return e } func (e *htmlImg) OnSubmit(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("submit", h, scope...) return e } func (e *htmlImg) OnSuspend(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("suspend", h, scope...) return e } func (e *htmlImg) OnTimeUpdate(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("timeupdate", h, scope...) return e } func (e *htmlImg) OnVolumeChange(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("volumechange", h, scope...) return e } func (e *htmlImg) OnWaiting(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("waiting", h, scope...) return e } func (e *htmlImg) OnWheel(h EventHandler, scope ...any) HTMLImg { e.setEventHandler("wheel", h, scope...) return e } // HTMLInput is the interface that describes a "input" HTML element. type HTMLInput interface { UI // Accept specifies the types of files that the server accepts (only for file type). Accept(v string) HTMLInput // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLInput // Alt specifies an alternate text when the original element fails to display. Alt(v string) HTMLInput // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLInput // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLInput // AutoComplete specifies whether the element should have autocomplete enabled. AutoComplete(v bool) HTMLInput // AutoFocus specifies that the element should automatically get focus when the page loads. AutoFocus(v bool) HTMLInput // Capture specifies the capture input method in file upload controls Capture(v string) HTMLInput // Checked specifies that an input element should be pre-selected when the page loads (for checkbox or radio types). Checked(v bool) HTMLInput // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLInput // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLInput // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLInput // Dir specifies the text direction for the content in an element. Dir(v string) HTMLInput // DirName specifies that the text direction will be submitted. DirName(v string) HTMLInput // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLInput // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLInput // Form specifies the name of the form the element belongs to. Form(v string) HTMLInput // FormAction specifies where to send the form-data when a form is submitted. Only for submit type. FormAction(v string) HTMLInput // FormEncType specifies how form-data should be encoded before sending it to a server. Only for submit type. FormEncType(v string) HTMLInput // FormMethod specifies how to send the form-data (which HTTP method to use). Only for submit type. FormMethod(v string) HTMLInput // FormNoValidate specifies that the form-data should not be validated on submission. Only for submit type. FormNoValidate(v bool) HTMLInput // FormTarget specifies where to display the response after submitting the form. Only for submit type. FormTarget(v string) HTMLInput // Height specifies the height of the element (in pixels). Height(v int) HTMLInput // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLInput // ID specifies a unique id for an element. ID(v string) HTMLInput // Lang specifies the language of the element's content. Lang(v string) HTMLInput // List refers to a datalist element that contains pre-defined options for an input element. List(v string) HTMLInput // Max Specifies the maximum value. Max(v any) HTMLInput // MaxLength specifies the maximum number of characters allowed in an element. MaxLength(v int) HTMLInput // Min specifies a minimum value. Min(v any) HTMLInput // Multiple specifies that a user can enter more than one value. Multiple(v bool) HTMLInput // Name specifies the name of the element. Name(v string) HTMLInput // Pattern specifies a regular expression that an input element's value is checked against. Pattern(v string) HTMLInput // Placeholder specifies a short hint that describes the expected value of the element. Placeholder(v string) HTMLInput // ReadOnly specifies that the element is read-only. ReadOnly(v bool) HTMLInput // Required specifies that the element must be filled out before submitting the form. Required(v bool) HTMLInput // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLInput // Size specifies the width. Size(v int) HTMLInput // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLInput // Src specifies the URL of the media file. Src(v string) HTMLInput // Step specifies the legal number intervals for an input field. Step(v float64) HTMLInput // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLInput // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLInput // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLInput // Title specifies extra information about an element. Title(v string) HTMLInput // Type specifies the type of element. Type(v string) HTMLInput // Value specifies the value of the element. Value(v any) HTMLInput // Width specifies the width of the element. Width(v int) HTMLInput // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLInput // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLInput // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLInput // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLInput // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLInput // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLInput // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLInput // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLInput // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLInput // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLInput // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLInput // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLInput // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLInput // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLInput // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLInput // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLInput // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLInput // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLInput // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLInput // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLInput // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLInput // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLInput // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLInput // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLInput // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLInput // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLInput // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLInput // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLInput // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLInput // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLInput // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLInput // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLInput // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLInput // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLInput } // Input returns an HTML element that defines an input control. func Input() HTMLInput { e := &htmlInput{ htmlElement: htmlElement{ tag: "input", isSelfClosing: true, }, } return e } type htmlInput struct { htmlElement } func (e *htmlInput) Accept(v string) HTMLInput { e.setAttr("accept", v) return e } func (e *htmlInput) AccessKey(v string) HTMLInput { e.setAttr("accesskey", v) return e } func (e *htmlInput) Alt(v string) HTMLInput { e.setAttr("alt", v) return e } func (e *htmlInput) Aria(k string, v any) HTMLInput { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlInput) Attr(n string, v any) HTMLInput { e.setAttr(n, v) return e } func (e *htmlInput) AutoComplete(v bool) HTMLInput { s := "off" if v { s = "on" } e.setAttr("autocomplete", s) return e } func (e *htmlInput) AutoFocus(v bool) HTMLInput { e.setAttr("autofocus", v) return e } func (e *htmlInput) Capture(v string) HTMLInput { e.setAttr("capture", v) return e } func (e *htmlInput) Checked(v bool) HTMLInput { e.setAttr("checked", v) return e } func (e *htmlInput) Class(v ...string) HTMLInput { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlInput) ContentEditable(v bool) HTMLInput { e.setAttr("contenteditable", v) return e } func (e *htmlInput) DataSet(k string, v any) HTMLInput { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlInput) Dir(v string) HTMLInput { e.setAttr("dir", v) return e } func (e *htmlInput) DirName(v string) HTMLInput { e.setAttr("dirname", v) return e } func (e *htmlInput) Disabled(v bool) HTMLInput { e.setAttr("disabled", v) return e } func (e *htmlInput) Draggable(v bool) HTMLInput { e.setAttr("draggable", v) return e } func (e *htmlInput) Form(v string) HTMLInput { e.setAttr("form", v) return e } func (e *htmlInput) FormAction(v string) HTMLInput { e.setAttr("formaction", v) return e } func (e *htmlInput) FormEncType(v string) HTMLInput { e.setAttr("formenctype", v) return e } func (e *htmlInput) FormMethod(v string) HTMLInput { e.setAttr("formmethod", v) return e } func (e *htmlInput) FormNoValidate(v bool) HTMLInput { e.setAttr("formnovalidate", v) return e } func (e *htmlInput) FormTarget(v string) HTMLInput { e.setAttr("formtarget", v) return e } func (e *htmlInput) Height(v int) HTMLInput { e.setAttr("height", v) return e } func (e *htmlInput) Hidden(v bool) HTMLInput { e.setAttr("hidden", v) return e } func (e *htmlInput) ID(v string) HTMLInput { e.setAttr("id", v) return e } func (e *htmlInput) Lang(v string) HTMLInput { e.setAttr("lang", v) return e } func (e *htmlInput) List(v string) HTMLInput { e.setAttr("list", v) return e } func (e *htmlInput) Max(v any) HTMLInput { e.setAttr("max", v) return e } func (e *htmlInput) MaxLength(v int) HTMLInput { e.setAttr("maxlength", v) return e } func (e *htmlInput) Min(v any) HTMLInput { e.setAttr("min", v) return e } func (e *htmlInput) Multiple(v bool) HTMLInput { e.setAttr("multiple", v) return e } func (e *htmlInput) Name(v string) HTMLInput { e.setAttr("name", v) return e } func (e *htmlInput) Pattern(v string) HTMLInput { e.setAttr("pattern", v) return e } func (e *htmlInput) Placeholder(v string) HTMLInput { e.setAttr("placeholder", v) return e } func (e *htmlInput) ReadOnly(v bool) HTMLInput { e.setAttr("readonly", v) return e } func (e *htmlInput) Required(v bool) HTMLInput { e.setAttr("required", v) return e } func (e *htmlInput) Role(v string) HTMLInput { e.setAttr("role", v) return e } func (e *htmlInput) Size(v int) HTMLInput { e.setAttr("size", v) return e } func (e *htmlInput) Spellcheck(v bool) HTMLInput { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlInput) Src(v string) HTMLInput { e.setAttr("src", v) return e } func (e *htmlInput) Step(v float64) HTMLInput { e.setAttr("step", v) return e } func (e *htmlInput) Style(k, v string) HTMLInput { e.setAttr("style", k+":"+v) return e } func (e *htmlInput) Styles(s map[string]string) HTMLInput { for k, v := range s { e.Style(k, v) } return e } func (e *htmlInput) TabIndex(v int) HTMLInput { e.setAttr("tabindex", v) return e } func (e *htmlInput) Title(v string) HTMLInput { e.setAttr("title", v) return e } func (e *htmlInput) Type(v string) HTMLInput { e.setAttr("type", v) return e } func (e *htmlInput) Value(v any) HTMLInput { e.setAttr("value", v) return e } func (e *htmlInput) Width(v int) HTMLInput { e.setAttr("width", v) return e } func (e *htmlInput) On(event string, h EventHandler, scope ...any) HTMLInput { e.setEventHandler(event, h, scope...) return e } func (e *htmlInput) OnBlur(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("blur", h, scope...) return e } func (e *htmlInput) OnChange(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("change", h, scope...) return e } func (e *htmlInput) OnClick(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("click", h, scope...) return e } func (e *htmlInput) OnContextMenu(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlInput) OnCopy(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("copy", h, scope...) return e } func (e *htmlInput) OnCut(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("cut", h, scope...) return e } func (e *htmlInput) OnDblClick(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlInput) OnDrag(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("drag", h, scope...) return e } func (e *htmlInput) OnDragEnd(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlInput) OnDragEnter(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlInput) OnDragLeave(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlInput) OnDragOver(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlInput) OnDragStart(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlInput) OnDrop(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("drop", h, scope...) return e } func (e *htmlInput) OnFocus(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("focus", h, scope...) return e } func (e *htmlInput) OnInput(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("input", h, scope...) return e } func (e *htmlInput) OnInvalid(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlInput) OnKeyDown(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlInput) OnKeyPress(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlInput) OnKeyUp(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlInput) OnLoad(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("load", h, scope...) return e } func (e *htmlInput) OnMouseDown(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlInput) OnMouseMove(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlInput) OnMouseOut(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlInput) OnMouseOver(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlInput) OnMouseUp(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlInput) OnPaste(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("paste", h, scope...) return e } func (e *htmlInput) OnReset(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("reset", h, scope...) return e } func (e *htmlInput) OnScroll(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlInput) OnSearch(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("search", h, scope...) return e } func (e *htmlInput) OnSelect(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("select", h, scope...) return e } func (e *htmlInput) OnSubmit(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("submit", h, scope...) return e } func (e *htmlInput) OnWheel(h EventHandler, scope ...any) HTMLInput { e.setEventHandler("wheel", h, scope...) return e } // HTMLIns is the interface that describes a "ins" HTML element. type HTMLIns interface { UI // Body set the content of the element. Body(elems ...UI) HTMLIns // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLIns // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLIns // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLIns // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLIns // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLIns // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLIns // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLIns // Dir specifies the text direction for the content in an element. Dir(v string) HTMLIns // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLIns // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLIns // ID specifies a unique id for an element. ID(v string) HTMLIns // Lang specifies the language of the element's content. Lang(v string) HTMLIns // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLIns // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLIns // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLIns // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLIns // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLIns // Title specifies extra information about an element. Title(v string) HTMLIns // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLIns // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLIns // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLIns // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLIns // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLIns // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLIns // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLIns // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLIns // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLIns // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLIns // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLIns // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLIns // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLIns // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLIns // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLIns // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLIns // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLIns // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLIns // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLIns // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLIns // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLIns // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLIns // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLIns // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLIns // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLIns // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLIns // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLIns // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLIns // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLIns // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLIns // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLIns // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLIns // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLIns } // Ins returns an HTML element that defines a text that has been inserted into a document. func Ins() HTMLIns { e := &htmlIns{ htmlElement: htmlElement{ tag: "ins", isSelfClosing: false, }, } return e } type htmlIns struct { htmlElement } func (e *htmlIns) Body(v ...UI) HTMLIns { e.setChildren(v...) return e } func (e *htmlIns) Text(v any) HTMLIns { return e.Body(Text(v)) } func (e *htmlIns) AccessKey(v string) HTMLIns { e.setAttr("accesskey", v) return e } func (e *htmlIns) Aria(k string, v any) HTMLIns { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlIns) Attr(n string, v any) HTMLIns { e.setAttr(n, v) return e } func (e *htmlIns) Class(v ...string) HTMLIns { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlIns) ContentEditable(v bool) HTMLIns { e.setAttr("contenteditable", v) return e } func (e *htmlIns) DataSet(k string, v any) HTMLIns { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlIns) Dir(v string) HTMLIns { e.setAttr("dir", v) return e } func (e *htmlIns) Draggable(v bool) HTMLIns { e.setAttr("draggable", v) return e } func (e *htmlIns) Hidden(v bool) HTMLIns { e.setAttr("hidden", v) return e } func (e *htmlIns) ID(v string) HTMLIns { e.setAttr("id", v) return e } func (e *htmlIns) Lang(v string) HTMLIns { e.setAttr("lang", v) return e } func (e *htmlIns) Role(v string) HTMLIns { e.setAttr("role", v) return e } func (e *htmlIns) Spellcheck(v bool) HTMLIns { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlIns) Style(k, v string) HTMLIns { e.setAttr("style", k+":"+v) return e } func (e *htmlIns) Styles(s map[string]string) HTMLIns { for k, v := range s { e.Style(k, v) } return e } func (e *htmlIns) TabIndex(v int) HTMLIns { e.setAttr("tabindex", v) return e } func (e *htmlIns) Title(v string) HTMLIns { e.setAttr("title", v) return e } func (e *htmlIns) On(event string, h EventHandler, scope ...any) HTMLIns { e.setEventHandler(event, h, scope...) return e } func (e *htmlIns) OnBlur(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("blur", h, scope...) return e } func (e *htmlIns) OnChange(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("change", h, scope...) return e } func (e *htmlIns) OnClick(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("click", h, scope...) return e } func (e *htmlIns) OnContextMenu(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlIns) OnCopy(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("copy", h, scope...) return e } func (e *htmlIns) OnCut(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("cut", h, scope...) return e } func (e *htmlIns) OnDblClick(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlIns) OnDrag(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("drag", h, scope...) return e } func (e *htmlIns) OnDragEnd(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlIns) OnDragEnter(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlIns) OnDragLeave(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlIns) OnDragOver(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlIns) OnDragStart(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlIns) OnDrop(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("drop", h, scope...) return e } func (e *htmlIns) OnFocus(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("focus", h, scope...) return e } func (e *htmlIns) OnInput(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("input", h, scope...) return e } func (e *htmlIns) OnInvalid(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlIns) OnKeyDown(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlIns) OnKeyPress(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlIns) OnKeyUp(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlIns) OnMouseDown(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlIns) OnMouseMove(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlIns) OnMouseOut(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlIns) OnMouseOver(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlIns) OnMouseUp(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlIns) OnPaste(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("paste", h, scope...) return e } func (e *htmlIns) OnReset(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("reset", h, scope...) return e } func (e *htmlIns) OnScroll(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlIns) OnSearch(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("search", h, scope...) return e } func (e *htmlIns) OnSelect(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("select", h, scope...) return e } func (e *htmlIns) OnSubmit(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("submit", h, scope...) return e } func (e *htmlIns) OnWheel(h EventHandler, scope ...any) HTMLIns { e.setEventHandler("wheel", h, scope...) return e } // HTMLKbd is the interface that describes a "kbd" HTML element. type HTMLKbd interface { UI // Body set the content of the element. Body(elems ...UI) HTMLKbd // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLKbd // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLKbd // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLKbd // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLKbd // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLKbd // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLKbd // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLKbd // Dir specifies the text direction for the content in an element. Dir(v string) HTMLKbd // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLKbd // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLKbd // ID specifies a unique id for an element. ID(v string) HTMLKbd // Lang specifies the language of the element's content. Lang(v string) HTMLKbd // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLKbd // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLKbd // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLKbd // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLKbd // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLKbd // Title specifies extra information about an element. Title(v string) HTMLKbd // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLKbd // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLKbd // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLKbd // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLKbd // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLKbd // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLKbd // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLKbd // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLKbd // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLKbd // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLKbd // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLKbd // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLKbd // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLKbd // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLKbd // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLKbd // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLKbd // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLKbd // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLKbd // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLKbd // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLKbd // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLKbd // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLKbd // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLKbd // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLKbd // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLKbd // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLKbd // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLKbd // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLKbd // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLKbd // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLKbd // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLKbd // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLKbd // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLKbd } // Kbd returns an HTML element that defines keyboard input. func Kbd() HTMLKbd { e := &htmlKbd{ htmlElement: htmlElement{ tag: "kbd", isSelfClosing: false, }, } return e } type htmlKbd struct { htmlElement } func (e *htmlKbd) Body(v ...UI) HTMLKbd { e.setChildren(v...) return e } func (e *htmlKbd) Text(v any) HTMLKbd { return e.Body(Text(v)) } func (e *htmlKbd) AccessKey(v string) HTMLKbd { e.setAttr("accesskey", v) return e } func (e *htmlKbd) Aria(k string, v any) HTMLKbd { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlKbd) Attr(n string, v any) HTMLKbd { e.setAttr(n, v) return e } func (e *htmlKbd) Class(v ...string) HTMLKbd { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlKbd) ContentEditable(v bool) HTMLKbd { e.setAttr("contenteditable", v) return e } func (e *htmlKbd) DataSet(k string, v any) HTMLKbd { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlKbd) Dir(v string) HTMLKbd { e.setAttr("dir", v) return e } func (e *htmlKbd) Draggable(v bool) HTMLKbd { e.setAttr("draggable", v) return e } func (e *htmlKbd) Hidden(v bool) HTMLKbd { e.setAttr("hidden", v) return e } func (e *htmlKbd) ID(v string) HTMLKbd { e.setAttr("id", v) return e } func (e *htmlKbd) Lang(v string) HTMLKbd { e.setAttr("lang", v) return e } func (e *htmlKbd) Role(v string) HTMLKbd { e.setAttr("role", v) return e } func (e *htmlKbd) Spellcheck(v bool) HTMLKbd { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlKbd) Style(k, v string) HTMLKbd { e.setAttr("style", k+":"+v) return e } func (e *htmlKbd) Styles(s map[string]string) HTMLKbd { for k, v := range s { e.Style(k, v) } return e } func (e *htmlKbd) TabIndex(v int) HTMLKbd { e.setAttr("tabindex", v) return e } func (e *htmlKbd) Title(v string) HTMLKbd { e.setAttr("title", v) return e } func (e *htmlKbd) On(event string, h EventHandler, scope ...any) HTMLKbd { e.setEventHandler(event, h, scope...) return e } func (e *htmlKbd) OnBlur(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("blur", h, scope...) return e } func (e *htmlKbd) OnChange(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("change", h, scope...) return e } func (e *htmlKbd) OnClick(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("click", h, scope...) return e } func (e *htmlKbd) OnContextMenu(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlKbd) OnCopy(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("copy", h, scope...) return e } func (e *htmlKbd) OnCut(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("cut", h, scope...) return e } func (e *htmlKbd) OnDblClick(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlKbd) OnDrag(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("drag", h, scope...) return e } func (e *htmlKbd) OnDragEnd(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlKbd) OnDragEnter(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlKbd) OnDragLeave(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlKbd) OnDragOver(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlKbd) OnDragStart(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlKbd) OnDrop(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("drop", h, scope...) return e } func (e *htmlKbd) OnFocus(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("focus", h, scope...) return e } func (e *htmlKbd) OnInput(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("input", h, scope...) return e } func (e *htmlKbd) OnInvalid(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlKbd) OnKeyDown(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlKbd) OnKeyPress(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlKbd) OnKeyUp(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlKbd) OnMouseDown(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlKbd) OnMouseMove(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlKbd) OnMouseOut(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlKbd) OnMouseOver(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlKbd) OnMouseUp(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlKbd) OnPaste(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("paste", h, scope...) return e } func (e *htmlKbd) OnReset(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("reset", h, scope...) return e } func (e *htmlKbd) OnScroll(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlKbd) OnSearch(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("search", h, scope...) return e } func (e *htmlKbd) OnSelect(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("select", h, scope...) return e } func (e *htmlKbd) OnSubmit(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("submit", h, scope...) return e } func (e *htmlKbd) OnWheel(h EventHandler, scope ...any) HTMLKbd { e.setEventHandler("wheel", h, scope...) return e } // HTMLLabel is the interface that describes a "label" HTML element. type HTMLLabel interface { UI // Body set the content of the element. Body(elems ...UI) HTMLLabel // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLLabel // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLLabel // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLLabel // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLLabel // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLLabel // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLLabel // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLLabel // Dir specifies the text direction for the content in an element. Dir(v string) HTMLLabel // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLLabel // For specifies which form element(s) a label/calculation is bound to. For(v string) HTMLLabel // Form specifies the name of the form the element belongs to. Form(v string) HTMLLabel // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLLabel // ID specifies a unique id for an element. ID(v string) HTMLLabel // Lang specifies the language of the element's content. Lang(v string) HTMLLabel // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLLabel // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLLabel // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLLabel // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLLabel // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLLabel // Title specifies extra information about an element. Title(v string) HTMLLabel // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLLabel // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLLabel // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLLabel // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLLabel // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLLabel // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLLabel // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLLabel // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLLabel // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLLabel // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLLabel // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLLabel // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLLabel // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLLabel // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLLabel // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLLabel // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLLabel // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLLabel // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLLabel // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLLabel // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLLabel // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLLabel // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLLabel // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLLabel // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLLabel // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLLabel // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLLabel // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLLabel // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLLabel // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLLabel // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLLabel // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLLabel // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLLabel // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLLabel } // Label returns an HTML element that defines a label for an input element. func Label() HTMLLabel { e := &htmlLabel{ htmlElement: htmlElement{ tag: "label", isSelfClosing: false, }, } return e } type htmlLabel struct { htmlElement } func (e *htmlLabel) Body(v ...UI) HTMLLabel { e.setChildren(v...) return e } func (e *htmlLabel) Text(v any) HTMLLabel { return e.Body(Text(v)) } func (e *htmlLabel) AccessKey(v string) HTMLLabel { e.setAttr("accesskey", v) return e } func (e *htmlLabel) Aria(k string, v any) HTMLLabel { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLabel) Attr(n string, v any) HTMLLabel { e.setAttr(n, v) return e } func (e *htmlLabel) Class(v ...string) HTMLLabel { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlLabel) ContentEditable(v bool) HTMLLabel { e.setAttr("contenteditable", v) return e } func (e *htmlLabel) DataSet(k string, v any) HTMLLabel { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLabel) Dir(v string) HTMLLabel { e.setAttr("dir", v) return e } func (e *htmlLabel) Draggable(v bool) HTMLLabel { e.setAttr("draggable", v) return e } func (e *htmlLabel) For(v string) HTMLLabel { e.setAttr("for", v) return e } func (e *htmlLabel) Form(v string) HTMLLabel { e.setAttr("form", v) return e } func (e *htmlLabel) Hidden(v bool) HTMLLabel { e.setAttr("hidden", v) return e } func (e *htmlLabel) ID(v string) HTMLLabel { e.setAttr("id", v) return e } func (e *htmlLabel) Lang(v string) HTMLLabel { e.setAttr("lang", v) return e } func (e *htmlLabel) Role(v string) HTMLLabel { e.setAttr("role", v) return e } func (e *htmlLabel) Spellcheck(v bool) HTMLLabel { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlLabel) Style(k, v string) HTMLLabel { e.setAttr("style", k+":"+v) return e } func (e *htmlLabel) Styles(s map[string]string) HTMLLabel { for k, v := range s { e.Style(k, v) } return e } func (e *htmlLabel) TabIndex(v int) HTMLLabel { e.setAttr("tabindex", v) return e } func (e *htmlLabel) Title(v string) HTMLLabel { e.setAttr("title", v) return e } func (e *htmlLabel) On(event string, h EventHandler, scope ...any) HTMLLabel { e.setEventHandler(event, h, scope...) return e } func (e *htmlLabel) OnBlur(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("blur", h, scope...) return e } func (e *htmlLabel) OnChange(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("change", h, scope...) return e } func (e *htmlLabel) OnClick(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("click", h, scope...) return e } func (e *htmlLabel) OnContextMenu(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlLabel) OnCopy(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("copy", h, scope...) return e } func (e *htmlLabel) OnCut(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("cut", h, scope...) return e } func (e *htmlLabel) OnDblClick(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlLabel) OnDrag(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("drag", h, scope...) return e } func (e *htmlLabel) OnDragEnd(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlLabel) OnDragEnter(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlLabel) OnDragLeave(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlLabel) OnDragOver(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlLabel) OnDragStart(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlLabel) OnDrop(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("drop", h, scope...) return e } func (e *htmlLabel) OnFocus(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("focus", h, scope...) return e } func (e *htmlLabel) OnInput(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("input", h, scope...) return e } func (e *htmlLabel) OnInvalid(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlLabel) OnKeyDown(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlLabel) OnKeyPress(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlLabel) OnKeyUp(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlLabel) OnMouseDown(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlLabel) OnMouseMove(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlLabel) OnMouseOut(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlLabel) OnMouseOver(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlLabel) OnMouseUp(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlLabel) OnPaste(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("paste", h, scope...) return e } func (e *htmlLabel) OnReset(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("reset", h, scope...) return e } func (e *htmlLabel) OnScroll(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlLabel) OnSearch(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("search", h, scope...) return e } func (e *htmlLabel) OnSelect(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("select", h, scope...) return e } func (e *htmlLabel) OnSubmit(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("submit", h, scope...) return e } func (e *htmlLabel) OnWheel(h EventHandler, scope ...any) HTMLLabel { e.setEventHandler("wheel", h, scope...) return e } // HTMLLegend is the interface that describes a "legend" HTML element. type HTMLLegend interface { UI // Body set the content of the element. Body(elems ...UI) HTMLLegend // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLLegend // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLLegend // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLLegend // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLLegend // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLLegend // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLLegend // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLLegend // Dir specifies the text direction for the content in an element. Dir(v string) HTMLLegend // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLLegend // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLLegend // ID specifies a unique id for an element. ID(v string) HTMLLegend // Lang specifies the language of the element's content. Lang(v string) HTMLLegend // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLLegend // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLLegend // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLLegend // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLLegend // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLLegend // Title specifies extra information about an element. Title(v string) HTMLLegend // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLLegend // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLLegend // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLLegend // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLLegend // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLLegend // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLLegend // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLLegend // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLLegend // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLLegend // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLLegend // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLLegend // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLLegend // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLLegend // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLLegend // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLLegend // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLLegend // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLLegend // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLLegend // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLLegend // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLLegend // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLLegend // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLLegend // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLLegend // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLLegend // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLLegend // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLLegend // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLLegend // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLLegend // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLLegend // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLLegend // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLLegend // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLLegend // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLLegend } // Legend returns an HTML element that defines a caption for a fieldset element. func Legend() HTMLLegend { e := &htmlLegend{ htmlElement: htmlElement{ tag: "legend", isSelfClosing: false, }, } return e } type htmlLegend struct { htmlElement } func (e *htmlLegend) Body(v ...UI) HTMLLegend { e.setChildren(v...) return e } func (e *htmlLegend) Text(v any) HTMLLegend { return e.Body(Text(v)) } func (e *htmlLegend) AccessKey(v string) HTMLLegend { e.setAttr("accesskey", v) return e } func (e *htmlLegend) Aria(k string, v any) HTMLLegend { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLegend) Attr(n string, v any) HTMLLegend { e.setAttr(n, v) return e } func (e *htmlLegend) Class(v ...string) HTMLLegend { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlLegend) ContentEditable(v bool) HTMLLegend { e.setAttr("contenteditable", v) return e } func (e *htmlLegend) DataSet(k string, v any) HTMLLegend { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLegend) Dir(v string) HTMLLegend { e.setAttr("dir", v) return e } func (e *htmlLegend) Draggable(v bool) HTMLLegend { e.setAttr("draggable", v) return e } func (e *htmlLegend) Hidden(v bool) HTMLLegend { e.setAttr("hidden", v) return e } func (e *htmlLegend) ID(v string) HTMLLegend { e.setAttr("id", v) return e } func (e *htmlLegend) Lang(v string) HTMLLegend { e.setAttr("lang", v) return e } func (e *htmlLegend) Role(v string) HTMLLegend { e.setAttr("role", v) return e } func (e *htmlLegend) Spellcheck(v bool) HTMLLegend { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlLegend) Style(k, v string) HTMLLegend { e.setAttr("style", k+":"+v) return e } func (e *htmlLegend) Styles(s map[string]string) HTMLLegend { for k, v := range s { e.Style(k, v) } return e } func (e *htmlLegend) TabIndex(v int) HTMLLegend { e.setAttr("tabindex", v) return e } func (e *htmlLegend) Title(v string) HTMLLegend { e.setAttr("title", v) return e } func (e *htmlLegend) On(event string, h EventHandler, scope ...any) HTMLLegend { e.setEventHandler(event, h, scope...) return e } func (e *htmlLegend) OnBlur(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("blur", h, scope...) return e } func (e *htmlLegend) OnChange(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("change", h, scope...) return e } func (e *htmlLegend) OnClick(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("click", h, scope...) return e } func (e *htmlLegend) OnContextMenu(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlLegend) OnCopy(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("copy", h, scope...) return e } func (e *htmlLegend) OnCut(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("cut", h, scope...) return e } func (e *htmlLegend) OnDblClick(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlLegend) OnDrag(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("drag", h, scope...) return e } func (e *htmlLegend) OnDragEnd(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlLegend) OnDragEnter(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlLegend) OnDragLeave(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlLegend) OnDragOver(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlLegend) OnDragStart(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlLegend) OnDrop(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("drop", h, scope...) return e } func (e *htmlLegend) OnFocus(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("focus", h, scope...) return e } func (e *htmlLegend) OnInput(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("input", h, scope...) return e } func (e *htmlLegend) OnInvalid(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlLegend) OnKeyDown(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlLegend) OnKeyPress(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlLegend) OnKeyUp(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlLegend) OnMouseDown(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlLegend) OnMouseMove(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlLegend) OnMouseOut(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlLegend) OnMouseOver(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlLegend) OnMouseUp(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlLegend) OnPaste(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("paste", h, scope...) return e } func (e *htmlLegend) OnReset(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("reset", h, scope...) return e } func (e *htmlLegend) OnScroll(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlLegend) OnSearch(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("search", h, scope...) return e } func (e *htmlLegend) OnSelect(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("select", h, scope...) return e } func (e *htmlLegend) OnSubmit(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("submit", h, scope...) return e } func (e *htmlLegend) OnWheel(h EventHandler, scope ...any) HTMLLegend { e.setEventHandler("wheel", h, scope...) return e } // HTMLLi is the interface that describes a "li" HTML element. type HTMLLi interface { UI // Body set the content of the element. Body(elems ...UI) HTMLLi // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLLi // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLLi // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLLi // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLLi // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLLi // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLLi // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLLi // Dir specifies the text direction for the content in an element. Dir(v string) HTMLLi // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLLi // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLLi // ID specifies a unique id for an element. ID(v string) HTMLLi // Lang specifies the language of the element's content. Lang(v string) HTMLLi // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLLi // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLLi // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLLi // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLLi // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLLi // Title specifies extra information about an element. Title(v string) HTMLLi // Value specifies the value of the element. Value(v any) HTMLLi // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLLi // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLLi // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLLi // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLLi // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLLi // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLLi // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLLi // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLLi // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLLi // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLLi // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLLi // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLLi // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLLi // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLLi // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLLi // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLLi // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLLi // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLLi // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLLi // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLLi // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLLi // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLLi // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLLi // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLLi // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLLi // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLLi // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLLi // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLLi // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLLi // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLLi // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLLi // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLLi // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLLi } // Li returns an HTML element that defines a list item. func Li() HTMLLi { e := &htmlLi{ htmlElement: htmlElement{ tag: "li", isSelfClosing: false, }, } return e } type htmlLi struct { htmlElement } func (e *htmlLi) Body(v ...UI) HTMLLi { e.setChildren(v...) return e } func (e *htmlLi) Text(v any) HTMLLi { return e.Body(Text(v)) } func (e *htmlLi) AccessKey(v string) HTMLLi { e.setAttr("accesskey", v) return e } func (e *htmlLi) Aria(k string, v any) HTMLLi { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLi) Attr(n string, v any) HTMLLi { e.setAttr(n, v) return e } func (e *htmlLi) Class(v ...string) HTMLLi { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlLi) ContentEditable(v bool) HTMLLi { e.setAttr("contenteditable", v) return e } func (e *htmlLi) DataSet(k string, v any) HTMLLi { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLi) Dir(v string) HTMLLi { e.setAttr("dir", v) return e } func (e *htmlLi) Draggable(v bool) HTMLLi { e.setAttr("draggable", v) return e } func (e *htmlLi) Hidden(v bool) HTMLLi { e.setAttr("hidden", v) return e } func (e *htmlLi) ID(v string) HTMLLi { e.setAttr("id", v) return e } func (e *htmlLi) Lang(v string) HTMLLi { e.setAttr("lang", v) return e } func (e *htmlLi) Role(v string) HTMLLi { e.setAttr("role", v) return e } func (e *htmlLi) Spellcheck(v bool) HTMLLi { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlLi) Style(k, v string) HTMLLi { e.setAttr("style", k+":"+v) return e } func (e *htmlLi) Styles(s map[string]string) HTMLLi { for k, v := range s { e.Style(k, v) } return e } func (e *htmlLi) TabIndex(v int) HTMLLi { e.setAttr("tabindex", v) return e } func (e *htmlLi) Title(v string) HTMLLi { e.setAttr("title", v) return e } func (e *htmlLi) Value(v any) HTMLLi { e.setAttr("value", v) return e } func (e *htmlLi) On(event string, h EventHandler, scope ...any) HTMLLi { e.setEventHandler(event, h, scope...) return e } func (e *htmlLi) OnBlur(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("blur", h, scope...) return e } func (e *htmlLi) OnChange(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("change", h, scope...) return e } func (e *htmlLi) OnClick(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("click", h, scope...) return e } func (e *htmlLi) OnContextMenu(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlLi) OnCopy(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("copy", h, scope...) return e } func (e *htmlLi) OnCut(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("cut", h, scope...) return e } func (e *htmlLi) OnDblClick(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlLi) OnDrag(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("drag", h, scope...) return e } func (e *htmlLi) OnDragEnd(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlLi) OnDragEnter(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlLi) OnDragLeave(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlLi) OnDragOver(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlLi) OnDragStart(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlLi) OnDrop(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("drop", h, scope...) return e } func (e *htmlLi) OnFocus(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("focus", h, scope...) return e } func (e *htmlLi) OnInput(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("input", h, scope...) return e } func (e *htmlLi) OnInvalid(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlLi) OnKeyDown(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlLi) OnKeyPress(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlLi) OnKeyUp(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlLi) OnMouseDown(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlLi) OnMouseMove(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlLi) OnMouseOut(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlLi) OnMouseOver(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlLi) OnMouseUp(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlLi) OnPaste(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("paste", h, scope...) return e } func (e *htmlLi) OnReset(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("reset", h, scope...) return e } func (e *htmlLi) OnScroll(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlLi) OnSearch(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("search", h, scope...) return e } func (e *htmlLi) OnSelect(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("select", h, scope...) return e } func (e *htmlLi) OnSubmit(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("submit", h, scope...) return e } func (e *htmlLi) OnWheel(h EventHandler, scope ...any) HTMLLi { e.setEventHandler("wheel", h, scope...) return e } // HTMLLink is the interface that describes a "link" HTML element. type HTMLLink interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLLink // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLLink // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLLink // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLLink // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLLink // CrossOrigin sets the mode of the request to an HTTP CORS Request. CrossOrigin(v string) HTMLLink // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLLink // Dir specifies the text direction for the content in an element. Dir(v string) HTMLLink // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLLink // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLLink // Href specifies the URL of the page the link goes to. Href(v string) HTMLLink // HrefLang specifies the language of the linked document. HrefLang(v string) HTMLLink // ID specifies a unique id for an element. ID(v string) HTMLLink // Lang specifies the language of the element's content. Lang(v string) HTMLLink // Media specifies what media/device the linked document is optimized for. Media(v string) HTMLLink // Rel specifies the relationship between the current document and the linked document. Rel(v string) HTMLLink // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLLink // Sizes specifies the size of the linked resource. Sizes(v string) HTMLLink // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLLink // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLLink // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLLink // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLLink // Title specifies extra information about an element. Title(v string) HTMLLink // Type specifies the type of element. Type(v string) HTMLLink // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLLink // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLLink // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLLink // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLLink // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLLink // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLLink // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLLink // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLLink // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLLink // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLLink // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLLink // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLLink // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLLink // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLLink // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLLink // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLLink // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLLink // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLLink // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLLink // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLLink // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLLink // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLLink // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLLink // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLLink // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLLink // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLLink // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLLink // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLLink // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLLink // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLLink // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLLink // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLLink // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLLink // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLLink } // Link returns an HTML element that defines the relationship between a document and an external resource (most used to link to style sheets). func Link() HTMLLink { e := &htmlLink{ htmlElement: htmlElement{ tag: "link", isSelfClosing: true, }, } return e } type htmlLink struct { htmlElement } func (e *htmlLink) AccessKey(v string) HTMLLink { e.setAttr("accesskey", v) return e } func (e *htmlLink) Aria(k string, v any) HTMLLink { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLink) Attr(n string, v any) HTMLLink { e.setAttr(n, v) return e } func (e *htmlLink) Class(v ...string) HTMLLink { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlLink) ContentEditable(v bool) HTMLLink { e.setAttr("contenteditable", v) return e } func (e *htmlLink) CrossOrigin(v string) HTMLLink { e.setAttr("crossorigin", v) return e } func (e *htmlLink) DataSet(k string, v any) HTMLLink { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlLink) Dir(v string) HTMLLink { e.setAttr("dir", v) return e } func (e *htmlLink) Draggable(v bool) HTMLLink { e.setAttr("draggable", v) return e } func (e *htmlLink) Hidden(v bool) HTMLLink { e.setAttr("hidden", v) return e } func (e *htmlLink) Href(v string) HTMLLink { e.setAttr("href", v) return e } func (e *htmlLink) HrefLang(v string) HTMLLink { e.setAttr("hreflang", v) return e } func (e *htmlLink) ID(v string) HTMLLink { e.setAttr("id", v) return e } func (e *htmlLink) Lang(v string) HTMLLink { e.setAttr("lang", v) return e } func (e *htmlLink) Media(v string) HTMLLink { e.setAttr("media", v) return e } func (e *htmlLink) Rel(v string) HTMLLink { e.setAttr("rel", v) return e } func (e *htmlLink) Role(v string) HTMLLink { e.setAttr("role", v) return e } func (e *htmlLink) Sizes(v string) HTMLLink { e.setAttr("sizes", v) return e } func (e *htmlLink) Spellcheck(v bool) HTMLLink { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlLink) Style(k, v string) HTMLLink { e.setAttr("style", k+":"+v) return e } func (e *htmlLink) Styles(s map[string]string) HTMLLink { for k, v := range s { e.Style(k, v) } return e } func (e *htmlLink) TabIndex(v int) HTMLLink { e.setAttr("tabindex", v) return e } func (e *htmlLink) Title(v string) HTMLLink { e.setAttr("title", v) return e } func (e *htmlLink) Type(v string) HTMLLink { e.setAttr("type", v) return e } func (e *htmlLink) On(event string, h EventHandler, scope ...any) HTMLLink { e.setEventHandler(event, h, scope...) return e } func (e *htmlLink) OnBlur(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("blur", h, scope...) return e } func (e *htmlLink) OnChange(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("change", h, scope...) return e } func (e *htmlLink) OnClick(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("click", h, scope...) return e } func (e *htmlLink) OnContextMenu(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlLink) OnCopy(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("copy", h, scope...) return e } func (e *htmlLink) OnCut(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("cut", h, scope...) return e } func (e *htmlLink) OnDblClick(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlLink) OnDrag(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("drag", h, scope...) return e } func (e *htmlLink) OnDragEnd(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlLink) OnDragEnter(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlLink) OnDragLeave(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlLink) OnDragOver(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlLink) OnDragStart(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlLink) OnDrop(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("drop", h, scope...) return e } func (e *htmlLink) OnFocus(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("focus", h, scope...) return e } func (e *htmlLink) OnInput(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("input", h, scope...) return e } func (e *htmlLink) OnInvalid(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlLink) OnKeyDown(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlLink) OnKeyPress(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlLink) OnKeyUp(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlLink) OnLoad(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("load", h, scope...) return e } func (e *htmlLink) OnMouseDown(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlLink) OnMouseMove(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlLink) OnMouseOut(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlLink) OnMouseOver(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlLink) OnMouseUp(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlLink) OnPaste(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("paste", h, scope...) return e } func (e *htmlLink) OnReset(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("reset", h, scope...) return e } func (e *htmlLink) OnScroll(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlLink) OnSearch(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("search", h, scope...) return e } func (e *htmlLink) OnSelect(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("select", h, scope...) return e } func (e *htmlLink) OnSubmit(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("submit", h, scope...) return e } func (e *htmlLink) OnWheel(h EventHandler, scope ...any) HTMLLink { e.setEventHandler("wheel", h, scope...) return e } // HTMLMain is the interface that describes a "main" HTML element. type HTMLMain interface { UI // Body set the content of the element. Body(elems ...UI) HTMLMain // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLMain // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLMain // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLMain // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLMain // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLMain // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLMain // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLMain // Dir specifies the text direction for the content in an element. Dir(v string) HTMLMain // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLMain // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLMain // ID specifies a unique id for an element. ID(v string) HTMLMain // Lang specifies the language of the element's content. Lang(v string) HTMLMain // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLMain // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLMain // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLMain // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLMain // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLMain // Title specifies extra information about an element. Title(v string) HTMLMain // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLMain // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLMain // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLMain // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLMain // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLMain // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLMain // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLMain // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLMain // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLMain // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLMain // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLMain // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLMain // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLMain // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLMain // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLMain // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLMain // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLMain // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLMain // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLMain // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLMain // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLMain // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLMain // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLMain // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLMain // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLMain // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLMain // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLMain // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLMain // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLMain // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLMain // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLMain // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLMain // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLMain } // Main returns an HTML element that specifies the main content of a document. func Main() HTMLMain { e := &htmlMain{ htmlElement: htmlElement{ tag: "main", isSelfClosing: false, }, } return e } type htmlMain struct { htmlElement } func (e *htmlMain) Body(v ...UI) HTMLMain { e.setChildren(v...) return e } func (e *htmlMain) Text(v any) HTMLMain { return e.Body(Text(v)) } func (e *htmlMain) AccessKey(v string) HTMLMain { e.setAttr("accesskey", v) return e } func (e *htmlMain) Aria(k string, v any) HTMLMain { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMain) Attr(n string, v any) HTMLMain { e.setAttr(n, v) return e } func (e *htmlMain) Class(v ...string) HTMLMain { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlMain) ContentEditable(v bool) HTMLMain { e.setAttr("contenteditable", v) return e } func (e *htmlMain) DataSet(k string, v any) HTMLMain { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMain) Dir(v string) HTMLMain { e.setAttr("dir", v) return e } func (e *htmlMain) Draggable(v bool) HTMLMain { e.setAttr("draggable", v) return e } func (e *htmlMain) Hidden(v bool) HTMLMain { e.setAttr("hidden", v) return e } func (e *htmlMain) ID(v string) HTMLMain { e.setAttr("id", v) return e } func (e *htmlMain) Lang(v string) HTMLMain { e.setAttr("lang", v) return e } func (e *htmlMain) Role(v string) HTMLMain { e.setAttr("role", v) return e } func (e *htmlMain) Spellcheck(v bool) HTMLMain { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlMain) Style(k, v string) HTMLMain { e.setAttr("style", k+":"+v) return e } func (e *htmlMain) Styles(s map[string]string) HTMLMain { for k, v := range s { e.Style(k, v) } return e } func (e *htmlMain) TabIndex(v int) HTMLMain { e.setAttr("tabindex", v) return e } func (e *htmlMain) Title(v string) HTMLMain { e.setAttr("title", v) return e } func (e *htmlMain) On(event string, h EventHandler, scope ...any) HTMLMain { e.setEventHandler(event, h, scope...) return e } func (e *htmlMain) OnBlur(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("blur", h, scope...) return e } func (e *htmlMain) OnChange(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("change", h, scope...) return e } func (e *htmlMain) OnClick(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("click", h, scope...) return e } func (e *htmlMain) OnContextMenu(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlMain) OnCopy(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("copy", h, scope...) return e } func (e *htmlMain) OnCut(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("cut", h, scope...) return e } func (e *htmlMain) OnDblClick(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlMain) OnDrag(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("drag", h, scope...) return e } func (e *htmlMain) OnDragEnd(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlMain) OnDragEnter(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlMain) OnDragLeave(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlMain) OnDragOver(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlMain) OnDragStart(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlMain) OnDrop(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("drop", h, scope...) return e } func (e *htmlMain) OnFocus(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("focus", h, scope...) return e } func (e *htmlMain) OnInput(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("input", h, scope...) return e } func (e *htmlMain) OnInvalid(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlMain) OnKeyDown(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlMain) OnKeyPress(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlMain) OnKeyUp(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlMain) OnMouseDown(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlMain) OnMouseMove(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlMain) OnMouseOut(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlMain) OnMouseOver(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlMain) OnMouseUp(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlMain) OnPaste(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("paste", h, scope...) return e } func (e *htmlMain) OnReset(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("reset", h, scope...) return e } func (e *htmlMain) OnScroll(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlMain) OnSearch(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("search", h, scope...) return e } func (e *htmlMain) OnSelect(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("select", h, scope...) return e } func (e *htmlMain) OnSubmit(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("submit", h, scope...) return e } func (e *htmlMain) OnWheel(h EventHandler, scope ...any) HTMLMain { e.setEventHandler("wheel", h, scope...) return e } // HTMLMap is the interface that describes a "map" HTML element. type HTMLMap interface { UI // Body set the content of the element. Body(elems ...UI) HTMLMap // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLMap // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLMap // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLMap // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLMap // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLMap // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLMap // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLMap // Dir specifies the text direction for the content in an element. Dir(v string) HTMLMap // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLMap // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLMap // ID specifies a unique id for an element. ID(v string) HTMLMap // Lang specifies the language of the element's content. Lang(v string) HTMLMap // Name specifies the name of the element. Name(v string) HTMLMap // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLMap // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLMap // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLMap // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLMap // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLMap // Title specifies extra information about an element. Title(v string) HTMLMap // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLMap // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLMap // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLMap // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLMap // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLMap // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLMap // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLMap // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLMap // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLMap // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLMap // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLMap // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLMap // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLMap // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLMap // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLMap // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLMap // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLMap // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLMap // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLMap // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLMap // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLMap // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLMap // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLMap // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLMap // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLMap // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLMap // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLMap // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLMap // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLMap // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLMap // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLMap // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLMap // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLMap } // Map returns an HTML element that defines a client-side image-map. func Map() HTMLMap { e := &htmlMap{ htmlElement: htmlElement{ tag: "map", isSelfClosing: false, }, } return e } type htmlMap struct { htmlElement } func (e *htmlMap) Body(v ...UI) HTMLMap { e.setChildren(v...) return e } func (e *htmlMap) Text(v any) HTMLMap { return e.Body(Text(v)) } func (e *htmlMap) AccessKey(v string) HTMLMap { e.setAttr("accesskey", v) return e } func (e *htmlMap) Aria(k string, v any) HTMLMap { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMap) Attr(n string, v any) HTMLMap { e.setAttr(n, v) return e } func (e *htmlMap) Class(v ...string) HTMLMap { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlMap) ContentEditable(v bool) HTMLMap { e.setAttr("contenteditable", v) return e } func (e *htmlMap) DataSet(k string, v any) HTMLMap { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMap) Dir(v string) HTMLMap { e.setAttr("dir", v) return e } func (e *htmlMap) Draggable(v bool) HTMLMap { e.setAttr("draggable", v) return e } func (e *htmlMap) Hidden(v bool) HTMLMap { e.setAttr("hidden", v) return e } func (e *htmlMap) ID(v string) HTMLMap { e.setAttr("id", v) return e } func (e *htmlMap) Lang(v string) HTMLMap { e.setAttr("lang", v) return e } func (e *htmlMap) Name(v string) HTMLMap { e.setAttr("name", v) return e } func (e *htmlMap) Role(v string) HTMLMap { e.setAttr("role", v) return e } func (e *htmlMap) Spellcheck(v bool) HTMLMap { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlMap) Style(k, v string) HTMLMap { e.setAttr("style", k+":"+v) return e } func (e *htmlMap) Styles(s map[string]string) HTMLMap { for k, v := range s { e.Style(k, v) } return e } func (e *htmlMap) TabIndex(v int) HTMLMap { e.setAttr("tabindex", v) return e } func (e *htmlMap) Title(v string) HTMLMap { e.setAttr("title", v) return e } func (e *htmlMap) On(event string, h EventHandler, scope ...any) HTMLMap { e.setEventHandler(event, h, scope...) return e } func (e *htmlMap) OnBlur(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("blur", h, scope...) return e } func (e *htmlMap) OnChange(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("change", h, scope...) return e } func (e *htmlMap) OnClick(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("click", h, scope...) return e } func (e *htmlMap) OnContextMenu(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlMap) OnCopy(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("copy", h, scope...) return e } func (e *htmlMap) OnCut(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("cut", h, scope...) return e } func (e *htmlMap) OnDblClick(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlMap) OnDrag(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("drag", h, scope...) return e } func (e *htmlMap) OnDragEnd(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlMap) OnDragEnter(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlMap) OnDragLeave(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlMap) OnDragOver(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlMap) OnDragStart(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlMap) OnDrop(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("drop", h, scope...) return e } func (e *htmlMap) OnFocus(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("focus", h, scope...) return e } func (e *htmlMap) OnInput(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("input", h, scope...) return e } func (e *htmlMap) OnInvalid(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlMap) OnKeyDown(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlMap) OnKeyPress(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlMap) OnKeyUp(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlMap) OnMouseDown(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlMap) OnMouseMove(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlMap) OnMouseOut(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlMap) OnMouseOver(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlMap) OnMouseUp(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlMap) OnPaste(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("paste", h, scope...) return e } func (e *htmlMap) OnReset(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("reset", h, scope...) return e } func (e *htmlMap) OnScroll(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlMap) OnSearch(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("search", h, scope...) return e } func (e *htmlMap) OnSelect(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("select", h, scope...) return e } func (e *htmlMap) OnSubmit(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("submit", h, scope...) return e } func (e *htmlMap) OnWheel(h EventHandler, scope ...any) HTMLMap { e.setEventHandler("wheel", h, scope...) return e } // HTMLMark is the interface that describes a "mark" HTML element. type HTMLMark interface { UI // Body set the content of the element. Body(elems ...UI) HTMLMark // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLMark // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLMark // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLMark // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLMark // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLMark // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLMark // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLMark // Dir specifies the text direction for the content in an element. Dir(v string) HTMLMark // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLMark // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLMark // ID specifies a unique id for an element. ID(v string) HTMLMark // Lang specifies the language of the element's content. Lang(v string) HTMLMark // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLMark // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLMark // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLMark // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLMark // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLMark // Title specifies extra information about an element. Title(v string) HTMLMark // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLMark // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLMark // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLMark // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLMark // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLMark // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLMark // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLMark // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLMark // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLMark // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLMark // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLMark // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLMark // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLMark // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLMark // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLMark // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLMark // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLMark // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLMark // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLMark // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLMark // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLMark // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLMark // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLMark // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLMark // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLMark // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLMark // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLMark // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLMark // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLMark // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLMark // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLMark // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLMark // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLMark } // Mark returns an HTML element that defines marked/highlighted text. func Mark() HTMLMark { e := &htmlMark{ htmlElement: htmlElement{ tag: "mark", isSelfClosing: false, }, } return e } type htmlMark struct { htmlElement } func (e *htmlMark) Body(v ...UI) HTMLMark { e.setChildren(v...) return e } func (e *htmlMark) Text(v any) HTMLMark { return e.Body(Text(v)) } func (e *htmlMark) AccessKey(v string) HTMLMark { e.setAttr("accesskey", v) return e } func (e *htmlMark) Aria(k string, v any) HTMLMark { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMark) Attr(n string, v any) HTMLMark { e.setAttr(n, v) return e } func (e *htmlMark) Class(v ...string) HTMLMark { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlMark) ContentEditable(v bool) HTMLMark { e.setAttr("contenteditable", v) return e } func (e *htmlMark) DataSet(k string, v any) HTMLMark { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMark) Dir(v string) HTMLMark { e.setAttr("dir", v) return e } func (e *htmlMark) Draggable(v bool) HTMLMark { e.setAttr("draggable", v) return e } func (e *htmlMark) Hidden(v bool) HTMLMark { e.setAttr("hidden", v) return e } func (e *htmlMark) ID(v string) HTMLMark { e.setAttr("id", v) return e } func (e *htmlMark) Lang(v string) HTMLMark { e.setAttr("lang", v) return e } func (e *htmlMark) Role(v string) HTMLMark { e.setAttr("role", v) return e } func (e *htmlMark) Spellcheck(v bool) HTMLMark { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlMark) Style(k, v string) HTMLMark { e.setAttr("style", k+":"+v) return e } func (e *htmlMark) Styles(s map[string]string) HTMLMark { for k, v := range s { e.Style(k, v) } return e } func (e *htmlMark) TabIndex(v int) HTMLMark { e.setAttr("tabindex", v) return e } func (e *htmlMark) Title(v string) HTMLMark { e.setAttr("title", v) return e } func (e *htmlMark) On(event string, h EventHandler, scope ...any) HTMLMark { e.setEventHandler(event, h, scope...) return e } func (e *htmlMark) OnBlur(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("blur", h, scope...) return e } func (e *htmlMark) OnChange(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("change", h, scope...) return e } func (e *htmlMark) OnClick(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("click", h, scope...) return e } func (e *htmlMark) OnContextMenu(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlMark) OnCopy(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("copy", h, scope...) return e } func (e *htmlMark) OnCut(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("cut", h, scope...) return e } func (e *htmlMark) OnDblClick(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlMark) OnDrag(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("drag", h, scope...) return e } func (e *htmlMark) OnDragEnd(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlMark) OnDragEnter(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlMark) OnDragLeave(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlMark) OnDragOver(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlMark) OnDragStart(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlMark) OnDrop(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("drop", h, scope...) return e } func (e *htmlMark) OnFocus(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("focus", h, scope...) return e } func (e *htmlMark) OnInput(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("input", h, scope...) return e } func (e *htmlMark) OnInvalid(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlMark) OnKeyDown(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlMark) OnKeyPress(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlMark) OnKeyUp(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlMark) OnMouseDown(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlMark) OnMouseMove(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlMark) OnMouseOut(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlMark) OnMouseOver(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlMark) OnMouseUp(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlMark) OnPaste(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("paste", h, scope...) return e } func (e *htmlMark) OnReset(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("reset", h, scope...) return e } func (e *htmlMark) OnScroll(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlMark) OnSearch(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("search", h, scope...) return e } func (e *htmlMark) OnSelect(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("select", h, scope...) return e } func (e *htmlMark) OnSubmit(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("submit", h, scope...) return e } func (e *htmlMark) OnWheel(h EventHandler, scope ...any) HTMLMark { e.setEventHandler("wheel", h, scope...) return e } // HTMLMeta is the interface that describes a "meta" HTML element. type HTMLMeta interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLMeta // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLMeta // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLMeta // Charset specifies the character encoding. Charset(v string) HTMLMeta // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLMeta // Content gives the value associated with the http-equiv or name attribute. Content(v string) HTMLMeta // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLMeta // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLMeta // Dir specifies the text direction for the content in an element. Dir(v string) HTMLMeta // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLMeta // HTTPEquiv provides an HTTP header for the information/value of the content attribute. HTTPEquiv(v string) HTMLMeta // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLMeta // ID specifies a unique id for an element. ID(v string) HTMLMeta // Lang specifies the language of the element's content. Lang(v string) HTMLMeta // Name specifies the name of the element. Name(v string) HTMLMeta // Property specifies the property name. Property(v string) HTMLMeta // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLMeta // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLMeta // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLMeta // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLMeta // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLMeta // Title specifies extra information about an element. Title(v string) HTMLMeta // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLMeta } // Meta returns an HTML element that . func Meta() HTMLMeta { e := &htmlMeta{ htmlElement: htmlElement{ tag: "meta", isSelfClosing: true, }, } return e } type htmlMeta struct { htmlElement } func (e *htmlMeta) AccessKey(v string) HTMLMeta { e.setAttr("accesskey", v) return e } func (e *htmlMeta) Aria(k string, v any) HTMLMeta { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMeta) Attr(n string, v any) HTMLMeta { e.setAttr(n, v) return e } func (e *htmlMeta) Charset(v string) HTMLMeta { e.setAttr("charset", v) return e } func (e *htmlMeta) Class(v ...string) HTMLMeta { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlMeta) Content(v string) HTMLMeta { e.setAttr("content", v) return e } func (e *htmlMeta) ContentEditable(v bool) HTMLMeta { e.setAttr("contenteditable", v) return e } func (e *htmlMeta) DataSet(k string, v any) HTMLMeta { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMeta) Dir(v string) HTMLMeta { e.setAttr("dir", v) return e } func (e *htmlMeta) Draggable(v bool) HTMLMeta { e.setAttr("draggable", v) return e } func (e *htmlMeta) HTTPEquiv(v string) HTMLMeta { e.setAttr("http-equiv", v) return e } func (e *htmlMeta) Hidden(v bool) HTMLMeta { e.setAttr("hidden", v) return e } func (e *htmlMeta) ID(v string) HTMLMeta { e.setAttr("id", v) return e } func (e *htmlMeta) Lang(v string) HTMLMeta { e.setAttr("lang", v) return e } func (e *htmlMeta) Name(v string) HTMLMeta { e.setAttr("name", v) return e } func (e *htmlMeta) Property(v string) HTMLMeta { e.setAttr("property", v) return e } func (e *htmlMeta) Role(v string) HTMLMeta { e.setAttr("role", v) return e } func (e *htmlMeta) Spellcheck(v bool) HTMLMeta { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlMeta) Style(k, v string) HTMLMeta { e.setAttr("style", k+":"+v) return e } func (e *htmlMeta) Styles(s map[string]string) HTMLMeta { for k, v := range s { e.Style(k, v) } return e } func (e *htmlMeta) TabIndex(v int) HTMLMeta { e.setAttr("tabindex", v) return e } func (e *htmlMeta) Title(v string) HTMLMeta { e.setAttr("title", v) return e } func (e *htmlMeta) On(event string, h EventHandler, scope ...any) HTMLMeta { e.setEventHandler(event, h, scope...) return e } // HTMLMeter is the interface that describes a "meter" HTML element. type HTMLMeter interface { UI // Body set the content of the element. Body(elems ...UI) HTMLMeter // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLMeter // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLMeter // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLMeter // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLMeter // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLMeter // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLMeter // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLMeter // Dir specifies the text direction for the content in an element. Dir(v string) HTMLMeter // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLMeter // Form specifies the name of the form the element belongs to. Form(v string) HTMLMeter // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLMeter // High specifies the range that is considered to be a high value. High(v float64) HTMLMeter // ID specifies a unique id for an element. ID(v string) HTMLMeter // Lang specifies the language of the element's content. Lang(v string) HTMLMeter // Low specifies the range that is considered to be a low value. Low(v float64) HTMLMeter // Max Specifies the maximum value. Max(v any) HTMLMeter // Min specifies a minimum value. Min(v any) HTMLMeter // Optimum specifies what value is the optimal value for the gauge. Optimum(v float64) HTMLMeter // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLMeter // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLMeter // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLMeter // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLMeter // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLMeter // Title specifies extra information about an element. Title(v string) HTMLMeter // Value specifies the value of the element. Value(v any) HTMLMeter // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLMeter // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLMeter // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLMeter // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLMeter // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLMeter // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLMeter // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLMeter // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLMeter // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLMeter // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLMeter // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLMeter // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLMeter // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLMeter // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLMeter // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLMeter // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLMeter // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLMeter // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLMeter // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLMeter // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLMeter // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLMeter // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLMeter // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLMeter // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLMeter // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLMeter // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLMeter // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLMeter // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLMeter // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLMeter // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLMeter // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLMeter // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLMeter // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLMeter } // Meter returns an HTML element that defines a scalar measurement within a known range (a gauge). func Meter() HTMLMeter { e := &htmlMeter{ htmlElement: htmlElement{ tag: "meter", isSelfClosing: false, }, } return e } type htmlMeter struct { htmlElement } func (e *htmlMeter) Body(v ...UI) HTMLMeter { e.setChildren(v...) return e } func (e *htmlMeter) Text(v any) HTMLMeter { return e.Body(Text(v)) } func (e *htmlMeter) AccessKey(v string) HTMLMeter { e.setAttr("accesskey", v) return e } func (e *htmlMeter) Aria(k string, v any) HTMLMeter { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMeter) Attr(n string, v any) HTMLMeter { e.setAttr(n, v) return e } func (e *htmlMeter) Class(v ...string) HTMLMeter { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlMeter) ContentEditable(v bool) HTMLMeter { e.setAttr("contenteditable", v) return e } func (e *htmlMeter) DataSet(k string, v any) HTMLMeter { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlMeter) Dir(v string) HTMLMeter { e.setAttr("dir", v) return e } func (e *htmlMeter) Draggable(v bool) HTMLMeter { e.setAttr("draggable", v) return e } func (e *htmlMeter) Form(v string) HTMLMeter { e.setAttr("form", v) return e } func (e *htmlMeter) Hidden(v bool) HTMLMeter { e.setAttr("hidden", v) return e } func (e *htmlMeter) High(v float64) HTMLMeter { e.setAttr("high", v) return e } func (e *htmlMeter) ID(v string) HTMLMeter { e.setAttr("id", v) return e } func (e *htmlMeter) Lang(v string) HTMLMeter { e.setAttr("lang", v) return e } func (e *htmlMeter) Low(v float64) HTMLMeter { e.setAttr("low", v) return e } func (e *htmlMeter) Max(v any) HTMLMeter { e.setAttr("max", v) return e } func (e *htmlMeter) Min(v any) HTMLMeter { e.setAttr("min", v) return e } func (e *htmlMeter) Optimum(v float64) HTMLMeter { e.setAttr("optimum", v) return e } func (e *htmlMeter) Role(v string) HTMLMeter { e.setAttr("role", v) return e } func (e *htmlMeter) Spellcheck(v bool) HTMLMeter { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlMeter) Style(k, v string) HTMLMeter { e.setAttr("style", k+":"+v) return e } func (e *htmlMeter) Styles(s map[string]string) HTMLMeter { for k, v := range s { e.Style(k, v) } return e } func (e *htmlMeter) TabIndex(v int) HTMLMeter { e.setAttr("tabindex", v) return e } func (e *htmlMeter) Title(v string) HTMLMeter { e.setAttr("title", v) return e } func (e *htmlMeter) Value(v any) HTMLMeter { e.setAttr("value", v) return e } func (e *htmlMeter) On(event string, h EventHandler, scope ...any) HTMLMeter { e.setEventHandler(event, h, scope...) return e } func (e *htmlMeter) OnBlur(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("blur", h, scope...) return e } func (e *htmlMeter) OnChange(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("change", h, scope...) return e } func (e *htmlMeter) OnClick(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("click", h, scope...) return e } func (e *htmlMeter) OnContextMenu(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlMeter) OnCopy(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("copy", h, scope...) return e } func (e *htmlMeter) OnCut(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("cut", h, scope...) return e } func (e *htmlMeter) OnDblClick(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlMeter) OnDrag(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("drag", h, scope...) return e } func (e *htmlMeter) OnDragEnd(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlMeter) OnDragEnter(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlMeter) OnDragLeave(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlMeter) OnDragOver(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlMeter) OnDragStart(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlMeter) OnDrop(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("drop", h, scope...) return e } func (e *htmlMeter) OnFocus(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("focus", h, scope...) return e } func (e *htmlMeter) OnInput(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("input", h, scope...) return e } func (e *htmlMeter) OnInvalid(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlMeter) OnKeyDown(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlMeter) OnKeyPress(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlMeter) OnKeyUp(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlMeter) OnMouseDown(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlMeter) OnMouseMove(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlMeter) OnMouseOut(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlMeter) OnMouseOver(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlMeter) OnMouseUp(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlMeter) OnPaste(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("paste", h, scope...) return e } func (e *htmlMeter) OnReset(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("reset", h, scope...) return e } func (e *htmlMeter) OnScroll(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlMeter) OnSearch(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("search", h, scope...) return e } func (e *htmlMeter) OnSelect(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("select", h, scope...) return e } func (e *htmlMeter) OnSubmit(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("submit", h, scope...) return e } func (e *htmlMeter) OnWheel(h EventHandler, scope ...any) HTMLMeter { e.setEventHandler("wheel", h, scope...) return e } // HTMLNav is the interface that describes a "nav" HTML element. type HTMLNav interface { UI // Body set the content of the element. Body(elems ...UI) HTMLNav // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLNav // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLNav // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLNav // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLNav // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLNav // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLNav // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLNav // Dir specifies the text direction for the content in an element. Dir(v string) HTMLNav // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLNav // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLNav // ID specifies a unique id for an element. ID(v string) HTMLNav // Lang specifies the language of the element's content. Lang(v string) HTMLNav // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLNav // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLNav // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLNav // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLNav // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLNav // Title specifies extra information about an element. Title(v string) HTMLNav // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLNav // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLNav // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLNav // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLNav // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLNav // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLNav // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLNav // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLNav // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLNav // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLNav // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLNav // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLNav // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLNav // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLNav // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLNav // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLNav // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLNav // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLNav // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLNav // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLNav // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLNav // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLNav // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLNav // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLNav // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLNav // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLNav // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLNav // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLNav // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLNav // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLNav // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLNav // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLNav // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLNav } // Nav returns an HTML element that defines navigation links. func Nav() HTMLNav { e := &htmlNav{ htmlElement: htmlElement{ tag: "nav", isSelfClosing: false, }, } return e } type htmlNav struct { htmlElement } func (e *htmlNav) Body(v ...UI) HTMLNav { e.setChildren(v...) return e } func (e *htmlNav) Text(v any) HTMLNav { return e.Body(Text(v)) } func (e *htmlNav) AccessKey(v string) HTMLNav { e.setAttr("accesskey", v) return e } func (e *htmlNav) Aria(k string, v any) HTMLNav { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlNav) Attr(n string, v any) HTMLNav { e.setAttr(n, v) return e } func (e *htmlNav) Class(v ...string) HTMLNav { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlNav) ContentEditable(v bool) HTMLNav { e.setAttr("contenteditable", v) return e } func (e *htmlNav) DataSet(k string, v any) HTMLNav { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlNav) Dir(v string) HTMLNav { e.setAttr("dir", v) return e } func (e *htmlNav) Draggable(v bool) HTMLNav { e.setAttr("draggable", v) return e } func (e *htmlNav) Hidden(v bool) HTMLNav { e.setAttr("hidden", v) return e } func (e *htmlNav) ID(v string) HTMLNav { e.setAttr("id", v) return e } func (e *htmlNav) Lang(v string) HTMLNav { e.setAttr("lang", v) return e } func (e *htmlNav) Role(v string) HTMLNav { e.setAttr("role", v) return e } func (e *htmlNav) Spellcheck(v bool) HTMLNav { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlNav) Style(k, v string) HTMLNav { e.setAttr("style", k+":"+v) return e } func (e *htmlNav) Styles(s map[string]string) HTMLNav { for k, v := range s { e.Style(k, v) } return e } func (e *htmlNav) TabIndex(v int) HTMLNav { e.setAttr("tabindex", v) return e } func (e *htmlNav) Title(v string) HTMLNav { e.setAttr("title", v) return e } func (e *htmlNav) On(event string, h EventHandler, scope ...any) HTMLNav { e.setEventHandler(event, h, scope...) return e } func (e *htmlNav) OnBlur(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("blur", h, scope...) return e } func (e *htmlNav) OnChange(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("change", h, scope...) return e } func (e *htmlNav) OnClick(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("click", h, scope...) return e } func (e *htmlNav) OnContextMenu(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlNav) OnCopy(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("copy", h, scope...) return e } func (e *htmlNav) OnCut(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("cut", h, scope...) return e } func (e *htmlNav) OnDblClick(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlNav) OnDrag(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("drag", h, scope...) return e } func (e *htmlNav) OnDragEnd(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlNav) OnDragEnter(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlNav) OnDragLeave(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlNav) OnDragOver(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlNav) OnDragStart(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlNav) OnDrop(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("drop", h, scope...) return e } func (e *htmlNav) OnFocus(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("focus", h, scope...) return e } func (e *htmlNav) OnInput(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("input", h, scope...) return e } func (e *htmlNav) OnInvalid(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlNav) OnKeyDown(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlNav) OnKeyPress(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlNav) OnKeyUp(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlNav) OnMouseDown(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlNav) OnMouseMove(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlNav) OnMouseOut(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlNav) OnMouseOver(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlNav) OnMouseUp(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlNav) OnPaste(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("paste", h, scope...) return e } func (e *htmlNav) OnReset(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("reset", h, scope...) return e } func (e *htmlNav) OnScroll(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlNav) OnSearch(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("search", h, scope...) return e } func (e *htmlNav) OnSelect(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("select", h, scope...) return e } func (e *htmlNav) OnSubmit(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("submit", h, scope...) return e } func (e *htmlNav) OnWheel(h EventHandler, scope ...any) HTMLNav { e.setEventHandler("wheel", h, scope...) return e } // HTMLNoScript is the interface that describes a "noscript" HTML element. type HTMLNoScript interface { UI // Body set the content of the element. Body(elems ...UI) HTMLNoScript // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLNoScript // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLNoScript // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLNoScript // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLNoScript // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLNoScript // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLNoScript // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLNoScript // Dir specifies the text direction for the content in an element. Dir(v string) HTMLNoScript // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLNoScript // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLNoScript // ID specifies a unique id for an element. ID(v string) HTMLNoScript // Lang specifies the language of the element's content. Lang(v string) HTMLNoScript // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLNoScript // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLNoScript // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLNoScript // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLNoScript // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLNoScript // Title specifies extra information about an element. Title(v string) HTMLNoScript // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLNoScript } // NoScript returns an HTML element that defines an alternate content for users that do not support client-side scripts. func NoScript() HTMLNoScript { e := &htmlNoScript{ htmlElement: htmlElement{ tag: "noscript", isSelfClosing: false, }, } return e } type htmlNoScript struct { htmlElement } func (e *htmlNoScript) Body(v ...UI) HTMLNoScript { e.setChildren(v...) return e } func (e *htmlNoScript) Text(v any) HTMLNoScript { return e.Body(Text(v)) } func (e *htmlNoScript) AccessKey(v string) HTMLNoScript { e.setAttr("accesskey", v) return e } func (e *htmlNoScript) Aria(k string, v any) HTMLNoScript { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlNoScript) Attr(n string, v any) HTMLNoScript { e.setAttr(n, v) return e } func (e *htmlNoScript) Class(v ...string) HTMLNoScript { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlNoScript) ContentEditable(v bool) HTMLNoScript { e.setAttr("contenteditable", v) return e } func (e *htmlNoScript) DataSet(k string, v any) HTMLNoScript { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlNoScript) Dir(v string) HTMLNoScript { e.setAttr("dir", v) return e } func (e *htmlNoScript) Draggable(v bool) HTMLNoScript { e.setAttr("draggable", v) return e } func (e *htmlNoScript) Hidden(v bool) HTMLNoScript { e.setAttr("hidden", v) return e } func (e *htmlNoScript) ID(v string) HTMLNoScript { e.setAttr("id", v) return e } func (e *htmlNoScript) Lang(v string) HTMLNoScript { e.setAttr("lang", v) return e } func (e *htmlNoScript) Role(v string) HTMLNoScript { e.setAttr("role", v) return e } func (e *htmlNoScript) Spellcheck(v bool) HTMLNoScript { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlNoScript) Style(k, v string) HTMLNoScript { e.setAttr("style", k+":"+v) return e } func (e *htmlNoScript) Styles(s map[string]string) HTMLNoScript { for k, v := range s { e.Style(k, v) } return e } func (e *htmlNoScript) TabIndex(v int) HTMLNoScript { e.setAttr("tabindex", v) return e } func (e *htmlNoScript) Title(v string) HTMLNoScript { e.setAttr("title", v) return e } func (e *htmlNoScript) On(event string, h EventHandler, scope ...any) HTMLNoScript { e.setEventHandler(event, h, scope...) return e } // HTMLObject is the interface that describes a "object" HTML element. type HTMLObject interface { UI // Body set the content of the element. Body(elems ...UI) HTMLObject // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLObject // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLObject // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLObject // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLObject // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLObject // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLObject // Data specifies the URL of the resource to be used by the object. Data(v string) HTMLObject // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLObject // Dir specifies the text direction for the content in an element. Dir(v string) HTMLObject // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLObject // Form specifies the name of the form the element belongs to. Form(v string) HTMLObject // Height specifies the height of the element (in pixels). Height(v int) HTMLObject // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLObject // ID specifies a unique id for an element. ID(v string) HTMLObject // Lang specifies the language of the element's content. Lang(v string) HTMLObject // Name specifies the name of the element. Name(v string) HTMLObject // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLObject // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLObject // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLObject // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLObject // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLObject // Title specifies extra information about an element. Title(v string) HTMLObject // Type specifies the type of element. Type(v string) HTMLObject // UseMap specifies an image as a client-side image-map. UseMap(v string) HTMLObject // Width specifies the width of the element. Width(v int) HTMLObject // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLObject // OnAbort calls the given handler on abort. OnAbort(h EventHandler, scope ...any) HTMLObject // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLObject // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin). OnCanPlay(h EventHandler, scope ...any) HTMLObject // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering. OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLObject // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLObject // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLObject // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLObject // OnCueChange calls the given handler when the cue changes in a track element. OnCueChange(h EventHandler, scope ...any) HTMLObject // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLObject // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLObject // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLObject // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLObject // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLObject // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLObject // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLObject // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLObject // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLObject // OnDurationChange calls the given handler when the length of the media changes. OnDurationChange(h EventHandler, scope ...any) HTMLObject // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects). OnEmptied(h EventHandler, scope ...any) HTMLObject // OnEnded calls the given handler when the media has reach the end. OnEnded(h EventHandler, scope ...any) HTMLObject // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLObject // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLObject // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLObject // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLObject // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLObject // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLObject // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLObject // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded. OnLoadStart(h EventHandler, scope ...any) HTMLObject // OnLoadedData calls the given handler when media data is loaded. OnLoadedData(h EventHandler, scope ...any) HTMLObject // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded. OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLObject // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLObject // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLObject // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLObject // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLObject // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLObject // OnPause calls the given handler when the media is paused either by the user or programmatically. OnPause(h EventHandler, scope ...any) HTMLObject // OnPlay calls the given handler when the media is ready to start playing. OnPlay(h EventHandler, scope ...any) HTMLObject // OnPlaying calls the given handler when the media actually has started playing. OnPlaying(h EventHandler, scope ...any) HTMLObject // OnProgress calls the given handler when the browser is in the process of getting the media data. OnProgress(h EventHandler, scope ...any) HTMLObject // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). OnRateChange(h EventHandler, scope ...any) HTMLObject // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLObject // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLObject // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLObject // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended. OnSeeked(h EventHandler, scope ...any) HTMLObject // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active. OnSeeking(h EventHandler, scope ...any) HTMLObject // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLObject // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason. OnStalled(h EventHandler, scope ...any) HTMLObject // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLObject // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason. OnSuspend(h EventHandler, scope ...any) HTMLObject // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media). OnTimeUpdate(h EventHandler, scope ...any) HTMLObject // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute"). OnVolumeChange(h EventHandler, scope ...any) HTMLObject // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data). OnWaiting(h EventHandler, scope ...any) HTMLObject // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLObject } // Object returns an HTML element that defines an embedded object. func Object() HTMLObject { e := &htmlObject{ htmlElement: htmlElement{ tag: "object", isSelfClosing: false, }, } return e } type htmlObject struct { htmlElement } func (e *htmlObject) Body(v ...UI) HTMLObject { e.setChildren(v...) return e } func (e *htmlObject) Text(v any) HTMLObject { return e.Body(Text(v)) } func (e *htmlObject) AccessKey(v string) HTMLObject { e.setAttr("accesskey", v) return e } func (e *htmlObject) Aria(k string, v any) HTMLObject { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlObject) Attr(n string, v any) HTMLObject { e.setAttr(n, v) return e } func (e *htmlObject) Class(v ...string) HTMLObject { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlObject) ContentEditable(v bool) HTMLObject { e.setAttr("contenteditable", v) return e } func (e *htmlObject) Data(v string) HTMLObject { e.setAttr("data", v) return e } func (e *htmlObject) DataSet(k string, v any) HTMLObject { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlObject) Dir(v string) HTMLObject { e.setAttr("dir", v) return e } func (e *htmlObject) Draggable(v bool) HTMLObject { e.setAttr("draggable", v) return e } func (e *htmlObject) Form(v string) HTMLObject { e.setAttr("form", v) return e } func (e *htmlObject) Height(v int) HTMLObject { e.setAttr("height", v) return e } func (e *htmlObject) Hidden(v bool) HTMLObject { e.setAttr("hidden", v) return e } func (e *htmlObject) ID(v string) HTMLObject { e.setAttr("id", v) return e } func (e *htmlObject) Lang(v string) HTMLObject { e.setAttr("lang", v) return e } func (e *htmlObject) Name(v string) HTMLObject { e.setAttr("name", v) return e } func (e *htmlObject) Role(v string) HTMLObject { e.setAttr("role", v) return e } func (e *htmlObject) Spellcheck(v bool) HTMLObject { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlObject) Style(k, v string) HTMLObject { e.setAttr("style", k+":"+v) return e } func (e *htmlObject) Styles(s map[string]string) HTMLObject { for k, v := range s { e.Style(k, v) } return e } func (e *htmlObject) TabIndex(v int) HTMLObject { e.setAttr("tabindex", v) return e } func (e *htmlObject) Title(v string) HTMLObject { e.setAttr("title", v) return e } func (e *htmlObject) Type(v string) HTMLObject { e.setAttr("type", v) return e } func (e *htmlObject) UseMap(v string) HTMLObject { e.setAttr("usemap", v) return e } func (e *htmlObject) Width(v int) HTMLObject { e.setAttr("width", v) return e } func (e *htmlObject) On(event string, h EventHandler, scope ...any) HTMLObject { e.setEventHandler(event, h, scope...) return e } func (e *htmlObject) OnAbort(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("abort", h, scope...) return e } func (e *htmlObject) OnBlur(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("blur", h, scope...) return e } func (e *htmlObject) OnCanPlay(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("canplay", h, scope...) return e } func (e *htmlObject) OnCanPlayThrough(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("canplaythrough", h, scope...) return e } func (e *htmlObject) OnChange(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("change", h, scope...) return e } func (e *htmlObject) OnClick(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("click", h, scope...) return e } func (e *htmlObject) OnContextMenu(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlObject) OnCopy(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("copy", h, scope...) return e } func (e *htmlObject) OnCueChange(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("cuechange", h, scope...) return e } func (e *htmlObject) OnCut(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("cut", h, scope...) return e } func (e *htmlObject) OnDblClick(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlObject) OnDrag(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("drag", h, scope...) return e } func (e *htmlObject) OnDragEnd(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlObject) OnDragEnter(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlObject) OnDragLeave(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlObject) OnDragOver(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlObject) OnDragStart(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlObject) OnDrop(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("drop", h, scope...) return e } func (e *htmlObject) OnDurationChange(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("durationchange", h, scope...) return e } func (e *htmlObject) OnEmptied(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("emptied", h, scope...) return e } func (e *htmlObject) OnEnded(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("ended", h, scope...) return e } func (e *htmlObject) OnError(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("error", h, scope...) return e } func (e *htmlObject) OnFocus(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("focus", h, scope...) return e } func (e *htmlObject) OnInput(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("input", h, scope...) return e } func (e *htmlObject) OnInvalid(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlObject) OnKeyDown(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlObject) OnKeyPress(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlObject) OnKeyUp(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlObject) OnLoadStart(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("loadstart", h, scope...) return e } func (e *htmlObject) OnLoadedData(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("loadeddata", h, scope...) return e } func (e *htmlObject) OnLoadedMetaData(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("loadedmetadata", h, scope...) return e } func (e *htmlObject) OnMouseDown(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlObject) OnMouseMove(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlObject) OnMouseOut(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlObject) OnMouseOver(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlObject) OnMouseUp(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlObject) OnPaste(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("paste", h, scope...) return e } func (e *htmlObject) OnPause(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("pause", h, scope...) return e } func (e *htmlObject) OnPlay(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("play", h, scope...) return e } func (e *htmlObject) OnPlaying(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("playing", h, scope...) return e } func (e *htmlObject) OnProgress(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("progress", h, scope...) return e } func (e *htmlObject) OnRateChange(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("ratechange", h, scope...) return e } func (e *htmlObject) OnReset(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("reset", h, scope...) return e } func (e *htmlObject) OnScroll(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlObject) OnSearch(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("search", h, scope...) return e } func (e *htmlObject) OnSeeked(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("seeked", h, scope...) return e } func (e *htmlObject) OnSeeking(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("seeking", h, scope...) return e } func (e *htmlObject) OnSelect(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("select", h, scope...) return e } func (e *htmlObject) OnStalled(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("stalled", h, scope...) return e } func (e *htmlObject) OnSubmit(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("submit", h, scope...) return e } func (e *htmlObject) OnSuspend(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("suspend", h, scope...) return e } func (e *htmlObject) OnTimeUpdate(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("timeupdate", h, scope...) return e } func (e *htmlObject) OnVolumeChange(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("volumechange", h, scope...) return e } func (e *htmlObject) OnWaiting(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("waiting", h, scope...) return e } func (e *htmlObject) OnWheel(h EventHandler, scope ...any) HTMLObject { e.setEventHandler("wheel", h, scope...) return e } // HTMLOl is the interface that describes a "ol" HTML element. type HTMLOl interface { UI // Body set the content of the element. Body(elems ...UI) HTMLOl // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLOl // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLOl // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLOl // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLOl // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLOl // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLOl // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLOl // Dir specifies the text direction for the content in an element. Dir(v string) HTMLOl // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLOl // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLOl // ID specifies a unique id for an element. ID(v string) HTMLOl // Lang specifies the language of the element's content. Lang(v string) HTMLOl // Reversed specifies that the list order should be descending (9,8,7...). Reversed(v bool) HTMLOl // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLOl // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLOl // Start specifies the start value of the ordered list. Start(v int) HTMLOl // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLOl // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLOl // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLOl // Title specifies extra information about an element. Title(v string) HTMLOl // Type specifies the type of element. Type(v string) HTMLOl // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLOl // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLOl // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLOl // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLOl // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLOl // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLOl // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLOl // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLOl // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLOl // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLOl // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLOl // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLOl // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLOl // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLOl // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLOl // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLOl // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLOl // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLOl // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLOl // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLOl // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLOl // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLOl // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLOl // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLOl // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLOl // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLOl // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLOl // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLOl // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLOl // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLOl // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLOl // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLOl // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLOl } // Ol returns an HTML element that defines an ordered list. func Ol() HTMLOl { e := &htmlOl{ htmlElement: htmlElement{ tag: "ol", isSelfClosing: false, }, } return e } type htmlOl struct { htmlElement } func (e *htmlOl) Body(v ...UI) HTMLOl { e.setChildren(v...) return e } func (e *htmlOl) Text(v any) HTMLOl { return e.Body(Text(v)) } func (e *htmlOl) AccessKey(v string) HTMLOl { e.setAttr("accesskey", v) return e } func (e *htmlOl) Aria(k string, v any) HTMLOl { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOl) Attr(n string, v any) HTMLOl { e.setAttr(n, v) return e } func (e *htmlOl) Class(v ...string) HTMLOl { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlOl) ContentEditable(v bool) HTMLOl { e.setAttr("contenteditable", v) return e } func (e *htmlOl) DataSet(k string, v any) HTMLOl { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOl) Dir(v string) HTMLOl { e.setAttr("dir", v) return e } func (e *htmlOl) Draggable(v bool) HTMLOl { e.setAttr("draggable", v) return e } func (e *htmlOl) Hidden(v bool) HTMLOl { e.setAttr("hidden", v) return e } func (e *htmlOl) ID(v string) HTMLOl { e.setAttr("id", v) return e } func (e *htmlOl) Lang(v string) HTMLOl { e.setAttr("lang", v) return e } func (e *htmlOl) Reversed(v bool) HTMLOl { e.setAttr("reversed", v) return e } func (e *htmlOl) Role(v string) HTMLOl { e.setAttr("role", v) return e } func (e *htmlOl) Spellcheck(v bool) HTMLOl { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlOl) Start(v int) HTMLOl { e.setAttr("start", v) return e } func (e *htmlOl) Style(k, v string) HTMLOl { e.setAttr("style", k+":"+v) return e } func (e *htmlOl) Styles(s map[string]string) HTMLOl { for k, v := range s { e.Style(k, v) } return e } func (e *htmlOl) TabIndex(v int) HTMLOl { e.setAttr("tabindex", v) return e } func (e *htmlOl) Title(v string) HTMLOl { e.setAttr("title", v) return e } func (e *htmlOl) Type(v string) HTMLOl { e.setAttr("type", v) return e } func (e *htmlOl) On(event string, h EventHandler, scope ...any) HTMLOl { e.setEventHandler(event, h, scope...) return e } func (e *htmlOl) OnBlur(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("blur", h, scope...) return e } func (e *htmlOl) OnChange(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("change", h, scope...) return e } func (e *htmlOl) OnClick(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("click", h, scope...) return e } func (e *htmlOl) OnContextMenu(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlOl) OnCopy(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("copy", h, scope...) return e } func (e *htmlOl) OnCut(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("cut", h, scope...) return e } func (e *htmlOl) OnDblClick(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlOl) OnDrag(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("drag", h, scope...) return e } func (e *htmlOl) OnDragEnd(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlOl) OnDragEnter(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlOl) OnDragLeave(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlOl) OnDragOver(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlOl) OnDragStart(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlOl) OnDrop(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("drop", h, scope...) return e } func (e *htmlOl) OnFocus(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("focus", h, scope...) return e } func (e *htmlOl) OnInput(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("input", h, scope...) return e } func (e *htmlOl) OnInvalid(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlOl) OnKeyDown(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlOl) OnKeyPress(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlOl) OnKeyUp(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlOl) OnMouseDown(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlOl) OnMouseMove(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlOl) OnMouseOut(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlOl) OnMouseOver(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlOl) OnMouseUp(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlOl) OnPaste(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("paste", h, scope...) return e } func (e *htmlOl) OnReset(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("reset", h, scope...) return e } func (e *htmlOl) OnScroll(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlOl) OnSearch(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("search", h, scope...) return e } func (e *htmlOl) OnSelect(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("select", h, scope...) return e } func (e *htmlOl) OnSubmit(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("submit", h, scope...) return e } func (e *htmlOl) OnWheel(h EventHandler, scope ...any) HTMLOl { e.setEventHandler("wheel", h, scope...) return e } // HTMLOptGroup is the interface that describes a "optgroup" HTML element. type HTMLOptGroup interface { UI // Body set the content of the element. Body(elems ...UI) HTMLOptGroup // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLOptGroup // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLOptGroup // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLOptGroup // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLOptGroup // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLOptGroup // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLOptGroup // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLOptGroup // Dir specifies the text direction for the content in an element. Dir(v string) HTMLOptGroup // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLOptGroup // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLOptGroup // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLOptGroup // ID specifies a unique id for an element. ID(v string) HTMLOptGroup // Label specifies a shorter label for the option. Label(v string) HTMLOptGroup // Lang specifies the language of the element's content. Lang(v string) HTMLOptGroup // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLOptGroup // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLOptGroup // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLOptGroup // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLOptGroup // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLOptGroup // Title specifies extra information about an element. Title(v string) HTMLOptGroup // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLOptGroup // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLOptGroup // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLOptGroup // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLOptGroup // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLOptGroup // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLOptGroup // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLOptGroup // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLOptGroup // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLOptGroup // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLOptGroup // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLOptGroup // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLOptGroup // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLOptGroup // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLOptGroup // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLOptGroup // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLOptGroup // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLOptGroup // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLOptGroup // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLOptGroup // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLOptGroup // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLOptGroup } // OptGroup returns an HTML element that defines a group of related options in a drop-down list. func OptGroup() HTMLOptGroup { e := &htmlOptGroup{ htmlElement: htmlElement{ tag: "optgroup", isSelfClosing: false, }, } return e } type htmlOptGroup struct { htmlElement } func (e *htmlOptGroup) Body(v ...UI) HTMLOptGroup { e.setChildren(v...) return e } func (e *htmlOptGroup) Text(v any) HTMLOptGroup { return e.Body(Text(v)) } func (e *htmlOptGroup) AccessKey(v string) HTMLOptGroup { e.setAttr("accesskey", v) return e } func (e *htmlOptGroup) Aria(k string, v any) HTMLOptGroup { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOptGroup) Attr(n string, v any) HTMLOptGroup { e.setAttr(n, v) return e } func (e *htmlOptGroup) Class(v ...string) HTMLOptGroup { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlOptGroup) ContentEditable(v bool) HTMLOptGroup { e.setAttr("contenteditable", v) return e } func (e *htmlOptGroup) DataSet(k string, v any) HTMLOptGroup { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOptGroup) Dir(v string) HTMLOptGroup { e.setAttr("dir", v) return e } func (e *htmlOptGroup) Disabled(v bool) HTMLOptGroup { e.setAttr("disabled", v) return e } func (e *htmlOptGroup) Draggable(v bool) HTMLOptGroup { e.setAttr("draggable", v) return e } func (e *htmlOptGroup) Hidden(v bool) HTMLOptGroup { e.setAttr("hidden", v) return e } func (e *htmlOptGroup) ID(v string) HTMLOptGroup { e.setAttr("id", v) return e } func (e *htmlOptGroup) Label(v string) HTMLOptGroup { e.setAttr("label", v) return e } func (e *htmlOptGroup) Lang(v string) HTMLOptGroup { e.setAttr("lang", v) return e } func (e *htmlOptGroup) Role(v string) HTMLOptGroup { e.setAttr("role", v) return e } func (e *htmlOptGroup) Spellcheck(v bool) HTMLOptGroup { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlOptGroup) Style(k, v string) HTMLOptGroup { e.setAttr("style", k+":"+v) return e } func (e *htmlOptGroup) Styles(s map[string]string) HTMLOptGroup { for k, v := range s { e.Style(k, v) } return e } func (e *htmlOptGroup) TabIndex(v int) HTMLOptGroup { e.setAttr("tabindex", v) return e } func (e *htmlOptGroup) Title(v string) HTMLOptGroup { e.setAttr("title", v) return e } func (e *htmlOptGroup) On(event string, h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler(event, h, scope...) return e } func (e *htmlOptGroup) OnBlur(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("blur", h, scope...) return e } func (e *htmlOptGroup) OnChange(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("change", h, scope...) return e } func (e *htmlOptGroup) OnClick(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("click", h, scope...) return e } func (e *htmlOptGroup) OnContextMenu(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlOptGroup) OnCopy(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("copy", h, scope...) return e } func (e *htmlOptGroup) OnCut(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("cut", h, scope...) return e } func (e *htmlOptGroup) OnDblClick(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlOptGroup) OnDrag(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("drag", h, scope...) return e } func (e *htmlOptGroup) OnDragEnd(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlOptGroup) OnDragEnter(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlOptGroup) OnDragLeave(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlOptGroup) OnDragOver(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlOptGroup) OnDragStart(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlOptGroup) OnDrop(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("drop", h, scope...) return e } func (e *htmlOptGroup) OnFocus(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("focus", h, scope...) return e } func (e *htmlOptGroup) OnInput(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("input", h, scope...) return e } func (e *htmlOptGroup) OnInvalid(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlOptGroup) OnKeyDown(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlOptGroup) OnKeyPress(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlOptGroup) OnKeyUp(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlOptGroup) OnMouseDown(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlOptGroup) OnMouseMove(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlOptGroup) OnMouseOut(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlOptGroup) OnMouseOver(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlOptGroup) OnMouseUp(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlOptGroup) OnPaste(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("paste", h, scope...) return e } func (e *htmlOptGroup) OnReset(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("reset", h, scope...) return e } func (e *htmlOptGroup) OnScroll(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlOptGroup) OnSearch(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("search", h, scope...) return e } func (e *htmlOptGroup) OnSelect(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("select", h, scope...) return e } func (e *htmlOptGroup) OnSubmit(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("submit", h, scope...) return e } func (e *htmlOptGroup) OnWheel(h EventHandler, scope ...any) HTMLOptGroup { e.setEventHandler("wheel", h, scope...) return e } // HTMLOption is the interface that describes a "option" HTML element. type HTMLOption interface { UI // Body set the content of the element. Body(elems ...UI) HTMLOption // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLOption // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLOption // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLOption // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLOption // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLOption // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLOption // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLOption // Dir specifies the text direction for the content in an element. Dir(v string) HTMLOption // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLOption // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLOption // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLOption // ID specifies a unique id for an element. ID(v string) HTMLOption // Label specifies a shorter label for the option. Label(v string) HTMLOption // Lang specifies the language of the element's content. Lang(v string) HTMLOption // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLOption // Selected specifies that an option should be pre-selected when the page loads. Selected(v bool) HTMLOption // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLOption // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLOption // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLOption // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLOption // Title specifies extra information about an element. Title(v string) HTMLOption // Value specifies the value of the element. Value(v any) HTMLOption // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLOption // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLOption // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLOption // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLOption // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLOption // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLOption // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLOption // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLOption // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLOption // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLOption // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLOption // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLOption // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLOption // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLOption // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLOption // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLOption // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLOption // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLOption // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLOption // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLOption // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLOption // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLOption // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLOption // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLOption // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLOption // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLOption // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLOption // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLOption // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLOption // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLOption // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLOption // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLOption // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLOption } // Option returns an HTML element that defines an option in a drop-down list. func Option() HTMLOption { e := &htmlOption{ htmlElement: htmlElement{ tag: "option", isSelfClosing: false, }, } return e } type htmlOption struct { htmlElement } func (e *htmlOption) Body(v ...UI) HTMLOption { e.setChildren(v...) return e } func (e *htmlOption) Text(v any) HTMLOption { return e.Body(Text(v)) } func (e *htmlOption) AccessKey(v string) HTMLOption { e.setAttr("accesskey", v) return e } func (e *htmlOption) Aria(k string, v any) HTMLOption { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOption) Attr(n string, v any) HTMLOption { e.setAttr(n, v) return e } func (e *htmlOption) Class(v ...string) HTMLOption { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlOption) ContentEditable(v bool) HTMLOption { e.setAttr("contenteditable", v) return e } func (e *htmlOption) DataSet(k string, v any) HTMLOption { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOption) Dir(v string) HTMLOption { e.setAttr("dir", v) return e } func (e *htmlOption) Disabled(v bool) HTMLOption { e.setAttr("disabled", v) return e } func (e *htmlOption) Draggable(v bool) HTMLOption { e.setAttr("draggable", v) return e } func (e *htmlOption) Hidden(v bool) HTMLOption { e.setAttr("hidden", v) return e } func (e *htmlOption) ID(v string) HTMLOption { e.setAttr("id", v) return e } func (e *htmlOption) Label(v string) HTMLOption { e.setAttr("label", v) return e } func (e *htmlOption) Lang(v string) HTMLOption { e.setAttr("lang", v) return e } func (e *htmlOption) Role(v string) HTMLOption { e.setAttr("role", v) return e } func (e *htmlOption) Selected(v bool) HTMLOption { e.setAttr("selected", v) return e } func (e *htmlOption) Spellcheck(v bool) HTMLOption { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlOption) Style(k, v string) HTMLOption { e.setAttr("style", k+":"+v) return e } func (e *htmlOption) Styles(s map[string]string) HTMLOption { for k, v := range s { e.Style(k, v) } return e } func (e *htmlOption) TabIndex(v int) HTMLOption { e.setAttr("tabindex", v) return e } func (e *htmlOption) Title(v string) HTMLOption { e.setAttr("title", v) return e } func (e *htmlOption) Value(v any) HTMLOption { e.setAttr("value", v) return e } func (e *htmlOption) On(event string, h EventHandler, scope ...any) HTMLOption { e.setEventHandler(event, h, scope...) return e } func (e *htmlOption) OnBlur(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("blur", h, scope...) return e } func (e *htmlOption) OnChange(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("change", h, scope...) return e } func (e *htmlOption) OnClick(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("click", h, scope...) return e } func (e *htmlOption) OnContextMenu(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlOption) OnCopy(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("copy", h, scope...) return e } func (e *htmlOption) OnCut(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("cut", h, scope...) return e } func (e *htmlOption) OnDblClick(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlOption) OnDrag(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("drag", h, scope...) return e } func (e *htmlOption) OnDragEnd(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlOption) OnDragEnter(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlOption) OnDragLeave(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlOption) OnDragOver(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlOption) OnDragStart(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlOption) OnDrop(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("drop", h, scope...) return e } func (e *htmlOption) OnFocus(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("focus", h, scope...) return e } func (e *htmlOption) OnInput(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("input", h, scope...) return e } func (e *htmlOption) OnInvalid(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlOption) OnKeyDown(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlOption) OnKeyPress(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlOption) OnKeyUp(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlOption) OnMouseDown(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlOption) OnMouseMove(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlOption) OnMouseOut(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlOption) OnMouseOver(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlOption) OnMouseUp(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlOption) OnPaste(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("paste", h, scope...) return e } func (e *htmlOption) OnReset(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("reset", h, scope...) return e } func (e *htmlOption) OnScroll(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlOption) OnSearch(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("search", h, scope...) return e } func (e *htmlOption) OnSelect(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("select", h, scope...) return e } func (e *htmlOption) OnSubmit(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("submit", h, scope...) return e } func (e *htmlOption) OnWheel(h EventHandler, scope ...any) HTMLOption { e.setEventHandler("wheel", h, scope...) return e } // HTMLOutput is the interface that describes a "output" HTML element. type HTMLOutput interface { UI // Body set the content of the element. Body(elems ...UI) HTMLOutput // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLOutput // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLOutput // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLOutput // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLOutput // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLOutput // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLOutput // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLOutput // Dir specifies the text direction for the content in an element. Dir(v string) HTMLOutput // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLOutput // For specifies which form element(s) a label/calculation is bound to. For(v string) HTMLOutput // Form specifies the name of the form the element belongs to. Form(v string) HTMLOutput // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLOutput // ID specifies a unique id for an element. ID(v string) HTMLOutput // Lang specifies the language of the element's content. Lang(v string) HTMLOutput // Name specifies the name of the element. Name(v string) HTMLOutput // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLOutput // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLOutput // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLOutput // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLOutput // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLOutput // Title specifies extra information about an element. Title(v string) HTMLOutput // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLOutput // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLOutput // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLOutput // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLOutput // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLOutput // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLOutput // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLOutput // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLOutput // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLOutput // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLOutput // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLOutput // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLOutput // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLOutput // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLOutput // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLOutput // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLOutput // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLOutput // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLOutput // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLOutput // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLOutput // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLOutput // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLOutput // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLOutput // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLOutput // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLOutput // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLOutput // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLOutput // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLOutput // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLOutput // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLOutput // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLOutput // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLOutput // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLOutput } // Output returns an HTML element that . func Output() HTMLOutput { e := &htmlOutput{ htmlElement: htmlElement{ tag: "output", isSelfClosing: false, }, } return e } type htmlOutput struct { htmlElement } func (e *htmlOutput) Body(v ...UI) HTMLOutput { e.setChildren(v...) return e } func (e *htmlOutput) Text(v any) HTMLOutput { return e.Body(Text(v)) } func (e *htmlOutput) AccessKey(v string) HTMLOutput { e.setAttr("accesskey", v) return e } func (e *htmlOutput) Aria(k string, v any) HTMLOutput { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOutput) Attr(n string, v any) HTMLOutput { e.setAttr(n, v) return e } func (e *htmlOutput) Class(v ...string) HTMLOutput { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlOutput) ContentEditable(v bool) HTMLOutput { e.setAttr("contenteditable", v) return e } func (e *htmlOutput) DataSet(k string, v any) HTMLOutput { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlOutput) Dir(v string) HTMLOutput { e.setAttr("dir", v) return e } func (e *htmlOutput) Draggable(v bool) HTMLOutput { e.setAttr("draggable", v) return e } func (e *htmlOutput) For(v string) HTMLOutput { e.setAttr("for", v) return e } func (e *htmlOutput) Form(v string) HTMLOutput { e.setAttr("form", v) return e } func (e *htmlOutput) Hidden(v bool) HTMLOutput { e.setAttr("hidden", v) return e } func (e *htmlOutput) ID(v string) HTMLOutput { e.setAttr("id", v) return e } func (e *htmlOutput) Lang(v string) HTMLOutput { e.setAttr("lang", v) return e } func (e *htmlOutput) Name(v string) HTMLOutput { e.setAttr("name", v) return e } func (e *htmlOutput) Role(v string) HTMLOutput { e.setAttr("role", v) return e } func (e *htmlOutput) Spellcheck(v bool) HTMLOutput { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlOutput) Style(k, v string) HTMLOutput { e.setAttr("style", k+":"+v) return e } func (e *htmlOutput) Styles(s map[string]string) HTMLOutput { for k, v := range s { e.Style(k, v) } return e } func (e *htmlOutput) TabIndex(v int) HTMLOutput { e.setAttr("tabindex", v) return e } func (e *htmlOutput) Title(v string) HTMLOutput { e.setAttr("title", v) return e } func (e *htmlOutput) On(event string, h EventHandler, scope ...any) HTMLOutput { e.setEventHandler(event, h, scope...) return e } func (e *htmlOutput) OnBlur(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("blur", h, scope...) return e } func (e *htmlOutput) OnChange(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("change", h, scope...) return e } func (e *htmlOutput) OnClick(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("click", h, scope...) return e } func (e *htmlOutput) OnContextMenu(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlOutput) OnCopy(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("copy", h, scope...) return e } func (e *htmlOutput) OnCut(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("cut", h, scope...) return e } func (e *htmlOutput) OnDblClick(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlOutput) OnDrag(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("drag", h, scope...) return e } func (e *htmlOutput) OnDragEnd(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlOutput) OnDragEnter(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlOutput) OnDragLeave(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlOutput) OnDragOver(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlOutput) OnDragStart(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlOutput) OnDrop(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("drop", h, scope...) return e } func (e *htmlOutput) OnFocus(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("focus", h, scope...) return e } func (e *htmlOutput) OnInput(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("input", h, scope...) return e } func (e *htmlOutput) OnInvalid(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlOutput) OnKeyDown(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlOutput) OnKeyPress(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlOutput) OnKeyUp(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlOutput) OnMouseDown(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlOutput) OnMouseMove(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlOutput) OnMouseOut(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlOutput) OnMouseOver(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlOutput) OnMouseUp(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlOutput) OnPaste(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("paste", h, scope...) return e } func (e *htmlOutput) OnReset(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("reset", h, scope...) return e } func (e *htmlOutput) OnScroll(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlOutput) OnSearch(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("search", h, scope...) return e } func (e *htmlOutput) OnSelect(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("select", h, scope...) return e } func (e *htmlOutput) OnSubmit(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("submit", h, scope...) return e } func (e *htmlOutput) OnWheel(h EventHandler, scope ...any) HTMLOutput { e.setEventHandler("wheel", h, scope...) return e } // HTMLP is the interface that describes a "p" HTML element. type HTMLP interface { UI // Body set the content of the element. Body(elems ...UI) HTMLP // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLP // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLP // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLP // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLP // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLP // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLP // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLP // Dir specifies the text direction for the content in an element. Dir(v string) HTMLP // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLP // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLP // ID specifies a unique id for an element. ID(v string) HTMLP // Lang specifies the language of the element's content. Lang(v string) HTMLP // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLP // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLP // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLP // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLP // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLP // Title specifies extra information about an element. Title(v string) HTMLP // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLP // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLP // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLP // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLP // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLP // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLP // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLP // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLP // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLP // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLP // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLP // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLP // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLP // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLP // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLP // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLP // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLP // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLP // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLP // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLP // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLP // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLP // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLP // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLP // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLP // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLP // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLP // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLP // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLP // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLP // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLP // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLP // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLP } // P returns an HTML element that defines a paragraph. func P() HTMLP { e := &htmlP{ htmlElement: htmlElement{ tag: "p", isSelfClosing: false, }, } return e } type htmlP struct { htmlElement } func (e *htmlP) Body(v ...UI) HTMLP { e.setChildren(v...) return e } func (e *htmlP) Text(v any) HTMLP { return e.Body(Text(v)) } func (e *htmlP) AccessKey(v string) HTMLP { e.setAttr("accesskey", v) return e } func (e *htmlP) Aria(k string, v any) HTMLP { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlP) Attr(n string, v any) HTMLP { e.setAttr(n, v) return e } func (e *htmlP) Class(v ...string) HTMLP { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlP) ContentEditable(v bool) HTMLP { e.setAttr("contenteditable", v) return e } func (e *htmlP) DataSet(k string, v any) HTMLP { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlP) Dir(v string) HTMLP { e.setAttr("dir", v) return e } func (e *htmlP) Draggable(v bool) HTMLP { e.setAttr("draggable", v) return e } func (e *htmlP) Hidden(v bool) HTMLP { e.setAttr("hidden", v) return e } func (e *htmlP) ID(v string) HTMLP { e.setAttr("id", v) return e } func (e *htmlP) Lang(v string) HTMLP { e.setAttr("lang", v) return e } func (e *htmlP) Role(v string) HTMLP { e.setAttr("role", v) return e } func (e *htmlP) Spellcheck(v bool) HTMLP { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlP) Style(k, v string) HTMLP { e.setAttr("style", k+":"+v) return e } func (e *htmlP) Styles(s map[string]string) HTMLP { for k, v := range s { e.Style(k, v) } return e } func (e *htmlP) TabIndex(v int) HTMLP { e.setAttr("tabindex", v) return e } func (e *htmlP) Title(v string) HTMLP { e.setAttr("title", v) return e } func (e *htmlP) On(event string, h EventHandler, scope ...any) HTMLP { e.setEventHandler(event, h, scope...) return e } func (e *htmlP) OnBlur(h EventHandler, scope ...any) HTMLP { e.setEventHandler("blur", h, scope...) return e } func (e *htmlP) OnChange(h EventHandler, scope ...any) HTMLP { e.setEventHandler("change", h, scope...) return e } func (e *htmlP) OnClick(h EventHandler, scope ...any) HTMLP { e.setEventHandler("click", h, scope...) return e } func (e *htmlP) OnContextMenu(h EventHandler, scope ...any) HTMLP { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlP) OnCopy(h EventHandler, scope ...any) HTMLP { e.setEventHandler("copy", h, scope...) return e } func (e *htmlP) OnCut(h EventHandler, scope ...any) HTMLP { e.setEventHandler("cut", h, scope...) return e } func (e *htmlP) OnDblClick(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlP) OnDrag(h EventHandler, scope ...any) HTMLP { e.setEventHandler("drag", h, scope...) return e } func (e *htmlP) OnDragEnd(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlP) OnDragEnter(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlP) OnDragLeave(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlP) OnDragOver(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlP) OnDragStart(h EventHandler, scope ...any) HTMLP { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlP) OnDrop(h EventHandler, scope ...any) HTMLP { e.setEventHandler("drop", h, scope...) return e } func (e *htmlP) OnFocus(h EventHandler, scope ...any) HTMLP { e.setEventHandler("focus", h, scope...) return e } func (e *htmlP) OnInput(h EventHandler, scope ...any) HTMLP { e.setEventHandler("input", h, scope...) return e } func (e *htmlP) OnInvalid(h EventHandler, scope ...any) HTMLP { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlP) OnKeyDown(h EventHandler, scope ...any) HTMLP { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlP) OnKeyPress(h EventHandler, scope ...any) HTMLP { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlP) OnKeyUp(h EventHandler, scope ...any) HTMLP { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlP) OnMouseDown(h EventHandler, scope ...any) HTMLP { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlP) OnMouseMove(h EventHandler, scope ...any) HTMLP { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlP) OnMouseOut(h EventHandler, scope ...any) HTMLP { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlP) OnMouseOver(h EventHandler, scope ...any) HTMLP { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlP) OnMouseUp(h EventHandler, scope ...any) HTMLP { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlP) OnPaste(h EventHandler, scope ...any) HTMLP { e.setEventHandler("paste", h, scope...) return e } func (e *htmlP) OnReset(h EventHandler, scope ...any) HTMLP { e.setEventHandler("reset", h, scope...) return e } func (e *htmlP) OnScroll(h EventHandler, scope ...any) HTMLP { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlP) OnSearch(h EventHandler, scope ...any) HTMLP { e.setEventHandler("search", h, scope...) return e } func (e *htmlP) OnSelect(h EventHandler, scope ...any) HTMLP { e.setEventHandler("select", h, scope...) return e } func (e *htmlP) OnSubmit(h EventHandler, scope ...any) HTMLP { e.setEventHandler("submit", h, scope...) return e } func (e *htmlP) OnWheel(h EventHandler, scope ...any) HTMLP { e.setEventHandler("wheel", h, scope...) return e } // HTMLParam is the interface that describes a "param" HTML element. type HTMLParam interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLParam // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLParam // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLParam // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLParam // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLParam // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLParam // Dir specifies the text direction for the content in an element. Dir(v string) HTMLParam // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLParam // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLParam // ID specifies a unique id for an element. ID(v string) HTMLParam // Lang specifies the language of the element's content. Lang(v string) HTMLParam // Name specifies the name of the element. Name(v string) HTMLParam // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLParam // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLParam // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLParam // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLParam // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLParam // Title specifies extra information about an element. Title(v string) HTMLParam // Value specifies the value of the element. Value(v any) HTMLParam // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLParam // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLParam // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLParam // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLParam // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLParam // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLParam // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLParam // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLParam // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLParam // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLParam // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLParam // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLParam // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLParam // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLParam // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLParam // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLParam // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLParam // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLParam // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLParam // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLParam // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLParam // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLParam // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLParam // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLParam // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLParam // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLParam // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLParam // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLParam // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLParam // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLParam // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLParam // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLParam // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLParam } // Param returns an HTML element that defines a parameter for an object. func Param() HTMLParam { e := &htmlParam{ htmlElement: htmlElement{ tag: "param", isSelfClosing: true, }, } return e } type htmlParam struct { htmlElement } func (e *htmlParam) AccessKey(v string) HTMLParam { e.setAttr("accesskey", v) return e } func (e *htmlParam) Aria(k string, v any) HTMLParam { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlParam) Attr(n string, v any) HTMLParam { e.setAttr(n, v) return e } func (e *htmlParam) Class(v ...string) HTMLParam { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlParam) ContentEditable(v bool) HTMLParam { e.setAttr("contenteditable", v) return e } func (e *htmlParam) DataSet(k string, v any) HTMLParam { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlParam) Dir(v string) HTMLParam { e.setAttr("dir", v) return e } func (e *htmlParam) Draggable(v bool) HTMLParam { e.setAttr("draggable", v) return e } func (e *htmlParam) Hidden(v bool) HTMLParam { e.setAttr("hidden", v) return e } func (e *htmlParam) ID(v string) HTMLParam { e.setAttr("id", v) return e } func (e *htmlParam) Lang(v string) HTMLParam { e.setAttr("lang", v) return e } func (e *htmlParam) Name(v string) HTMLParam { e.setAttr("name", v) return e } func (e *htmlParam) Role(v string) HTMLParam { e.setAttr("role", v) return e } func (e *htmlParam) Spellcheck(v bool) HTMLParam { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlParam) Style(k, v string) HTMLParam { e.setAttr("style", k+":"+v) return e } func (e *htmlParam) Styles(s map[string]string) HTMLParam { for k, v := range s { e.Style(k, v) } return e } func (e *htmlParam) TabIndex(v int) HTMLParam { e.setAttr("tabindex", v) return e } func (e *htmlParam) Title(v string) HTMLParam { e.setAttr("title", v) return e } func (e *htmlParam) Value(v any) HTMLParam { e.setAttr("value", v) return e } func (e *htmlParam) On(event string, h EventHandler, scope ...any) HTMLParam { e.setEventHandler(event, h, scope...) return e } func (e *htmlParam) OnBlur(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("blur", h, scope...) return e } func (e *htmlParam) OnChange(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("change", h, scope...) return e } func (e *htmlParam) OnClick(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("click", h, scope...) return e } func (e *htmlParam) OnContextMenu(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlParam) OnCopy(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("copy", h, scope...) return e } func (e *htmlParam) OnCut(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("cut", h, scope...) return e } func (e *htmlParam) OnDblClick(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlParam) OnDrag(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("drag", h, scope...) return e } func (e *htmlParam) OnDragEnd(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlParam) OnDragEnter(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlParam) OnDragLeave(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlParam) OnDragOver(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlParam) OnDragStart(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlParam) OnDrop(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("drop", h, scope...) return e } func (e *htmlParam) OnFocus(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("focus", h, scope...) return e } func (e *htmlParam) OnInput(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("input", h, scope...) return e } func (e *htmlParam) OnInvalid(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlParam) OnKeyDown(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlParam) OnKeyPress(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlParam) OnKeyUp(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlParam) OnMouseDown(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlParam) OnMouseMove(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlParam) OnMouseOut(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlParam) OnMouseOver(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlParam) OnMouseUp(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlParam) OnPaste(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("paste", h, scope...) return e } func (e *htmlParam) OnReset(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("reset", h, scope...) return e } func (e *htmlParam) OnScroll(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlParam) OnSearch(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("search", h, scope...) return e } func (e *htmlParam) OnSelect(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("select", h, scope...) return e } func (e *htmlParam) OnSubmit(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("submit", h, scope...) return e } func (e *htmlParam) OnWheel(h EventHandler, scope ...any) HTMLParam { e.setEventHandler("wheel", h, scope...) return e } // HTMLPicture is the interface that describes a "picture" HTML element. type HTMLPicture interface { UI // Body set the content of the element. Body(elems ...UI) HTMLPicture // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLPicture // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLPicture // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLPicture // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLPicture // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLPicture // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLPicture // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLPicture // Dir specifies the text direction for the content in an element. Dir(v string) HTMLPicture // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLPicture // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLPicture // ID specifies a unique id for an element. ID(v string) HTMLPicture // Lang specifies the language of the element's content. Lang(v string) HTMLPicture // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLPicture // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLPicture // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLPicture // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLPicture // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLPicture // Title specifies extra information about an element. Title(v string) HTMLPicture // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLPicture // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLPicture // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLPicture // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLPicture // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLPicture // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLPicture // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLPicture // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLPicture // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLPicture // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLPicture // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLPicture // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLPicture // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLPicture // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLPicture // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLPicture // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLPicture // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLPicture // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLPicture // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLPicture // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLPicture // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLPicture // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLPicture // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLPicture // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLPicture // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLPicture // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLPicture // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLPicture // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLPicture // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLPicture // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLPicture // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLPicture // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLPicture // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLPicture } // Picture returns an HTML element that defines a container for multiple image resources. func Picture() HTMLPicture { e := &htmlPicture{ htmlElement: htmlElement{ tag: "picture", isSelfClosing: false, }, } return e } type htmlPicture struct { htmlElement } func (e *htmlPicture) Body(v ...UI) HTMLPicture { e.setChildren(v...) return e } func (e *htmlPicture) Text(v any) HTMLPicture { return e.Body(Text(v)) } func (e *htmlPicture) AccessKey(v string) HTMLPicture { e.setAttr("accesskey", v) return e } func (e *htmlPicture) Aria(k string, v any) HTMLPicture { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlPicture) Attr(n string, v any) HTMLPicture { e.setAttr(n, v) return e } func (e *htmlPicture) Class(v ...string) HTMLPicture { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlPicture) ContentEditable(v bool) HTMLPicture { e.setAttr("contenteditable", v) return e } func (e *htmlPicture) DataSet(k string, v any) HTMLPicture { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlPicture) Dir(v string) HTMLPicture { e.setAttr("dir", v) return e } func (e *htmlPicture) Draggable(v bool) HTMLPicture { e.setAttr("draggable", v) return e } func (e *htmlPicture) Hidden(v bool) HTMLPicture { e.setAttr("hidden", v) return e } func (e *htmlPicture) ID(v string) HTMLPicture { e.setAttr("id", v) return e } func (e *htmlPicture) Lang(v string) HTMLPicture { e.setAttr("lang", v) return e } func (e *htmlPicture) Role(v string) HTMLPicture { e.setAttr("role", v) return e } func (e *htmlPicture) Spellcheck(v bool) HTMLPicture { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlPicture) Style(k, v string) HTMLPicture { e.setAttr("style", k+":"+v) return e } func (e *htmlPicture) Styles(s map[string]string) HTMLPicture { for k, v := range s { e.Style(k, v) } return e } func (e *htmlPicture) TabIndex(v int) HTMLPicture { e.setAttr("tabindex", v) return e } func (e *htmlPicture) Title(v string) HTMLPicture { e.setAttr("title", v) return e } func (e *htmlPicture) On(event string, h EventHandler, scope ...any) HTMLPicture { e.setEventHandler(event, h, scope...) return e } func (e *htmlPicture) OnBlur(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("blur", h, scope...) return e } func (e *htmlPicture) OnChange(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("change", h, scope...) return e } func (e *htmlPicture) OnClick(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("click", h, scope...) return e } func (e *htmlPicture) OnContextMenu(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlPicture) OnCopy(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("copy", h, scope...) return e } func (e *htmlPicture) OnCut(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("cut", h, scope...) return e } func (e *htmlPicture) OnDblClick(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlPicture) OnDrag(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("drag", h, scope...) return e } func (e *htmlPicture) OnDragEnd(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlPicture) OnDragEnter(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlPicture) OnDragLeave(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlPicture) OnDragOver(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlPicture) OnDragStart(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlPicture) OnDrop(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("drop", h, scope...) return e } func (e *htmlPicture) OnFocus(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("focus", h, scope...) return e } func (e *htmlPicture) OnInput(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("input", h, scope...) return e } func (e *htmlPicture) OnInvalid(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlPicture) OnKeyDown(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlPicture) OnKeyPress(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlPicture) OnKeyUp(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlPicture) OnMouseDown(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlPicture) OnMouseMove(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlPicture) OnMouseOut(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlPicture) OnMouseOver(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlPicture) OnMouseUp(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlPicture) OnPaste(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("paste", h, scope...) return e } func (e *htmlPicture) OnReset(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("reset", h, scope...) return e } func (e *htmlPicture) OnScroll(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlPicture) OnSearch(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("search", h, scope...) return e } func (e *htmlPicture) OnSelect(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("select", h, scope...) return e } func (e *htmlPicture) OnSubmit(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("submit", h, scope...) return e } func (e *htmlPicture) OnWheel(h EventHandler, scope ...any) HTMLPicture { e.setEventHandler("wheel", h, scope...) return e } // HTMLPre is the interface that describes a "pre" HTML element. type HTMLPre interface { UI // Body set the content of the element. Body(elems ...UI) HTMLPre // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLPre // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLPre // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLPre // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLPre // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLPre // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLPre // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLPre // Dir specifies the text direction for the content in an element. Dir(v string) HTMLPre // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLPre // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLPre // ID specifies a unique id for an element. ID(v string) HTMLPre // Lang specifies the language of the element's content. Lang(v string) HTMLPre // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLPre // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLPre // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLPre // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLPre // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLPre // Title specifies extra information about an element. Title(v string) HTMLPre // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLPre // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLPre // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLPre // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLPre // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLPre // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLPre // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLPre // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLPre // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLPre // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLPre // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLPre // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLPre // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLPre // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLPre // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLPre // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLPre // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLPre // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLPre // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLPre // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLPre // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLPre // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLPre // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLPre // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLPre // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLPre // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLPre // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLPre // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLPre // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLPre // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLPre // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLPre // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLPre // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLPre } // Pre returns an HTML element that defines preformatted text. func Pre() HTMLPre { e := &htmlPre{ htmlElement: htmlElement{ tag: "pre", isSelfClosing: false, }, } return e } type htmlPre struct { htmlElement } func (e *htmlPre) Body(v ...UI) HTMLPre { e.setChildren(v...) return e } func (e *htmlPre) Text(v any) HTMLPre { return e.Body(Text(v)) } func (e *htmlPre) AccessKey(v string) HTMLPre { e.setAttr("accesskey", v) return e } func (e *htmlPre) Aria(k string, v any) HTMLPre { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlPre) Attr(n string, v any) HTMLPre { e.setAttr(n, v) return e } func (e *htmlPre) Class(v ...string) HTMLPre { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlPre) ContentEditable(v bool) HTMLPre { e.setAttr("contenteditable", v) return e } func (e *htmlPre) DataSet(k string, v any) HTMLPre { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlPre) Dir(v string) HTMLPre { e.setAttr("dir", v) return e } func (e *htmlPre) Draggable(v bool) HTMLPre { e.setAttr("draggable", v) return e } func (e *htmlPre) Hidden(v bool) HTMLPre { e.setAttr("hidden", v) return e } func (e *htmlPre) ID(v string) HTMLPre { e.setAttr("id", v) return e } func (e *htmlPre) Lang(v string) HTMLPre { e.setAttr("lang", v) return e } func (e *htmlPre) Role(v string) HTMLPre { e.setAttr("role", v) return e } func (e *htmlPre) Spellcheck(v bool) HTMLPre { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlPre) Style(k, v string) HTMLPre { e.setAttr("style", k+":"+v) return e } func (e *htmlPre) Styles(s map[string]string) HTMLPre { for k, v := range s { e.Style(k, v) } return e } func (e *htmlPre) TabIndex(v int) HTMLPre { e.setAttr("tabindex", v) return e } func (e *htmlPre) Title(v string) HTMLPre { e.setAttr("title", v) return e } func (e *htmlPre) On(event string, h EventHandler, scope ...any) HTMLPre { e.setEventHandler(event, h, scope...) return e } func (e *htmlPre) OnBlur(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("blur", h, scope...) return e } func (e *htmlPre) OnChange(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("change", h, scope...) return e } func (e *htmlPre) OnClick(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("click", h, scope...) return e } func (e *htmlPre) OnContextMenu(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlPre) OnCopy(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("copy", h, scope...) return e } func (e *htmlPre) OnCut(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("cut", h, scope...) return e } func (e *htmlPre) OnDblClick(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlPre) OnDrag(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("drag", h, scope...) return e } func (e *htmlPre) OnDragEnd(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlPre) OnDragEnter(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlPre) OnDragLeave(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlPre) OnDragOver(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlPre) OnDragStart(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlPre) OnDrop(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("drop", h, scope...) return e } func (e *htmlPre) OnFocus(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("focus", h, scope...) return e } func (e *htmlPre) OnInput(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("input", h, scope...) return e } func (e *htmlPre) OnInvalid(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlPre) OnKeyDown(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlPre) OnKeyPress(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlPre) OnKeyUp(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlPre) OnMouseDown(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlPre) OnMouseMove(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlPre) OnMouseOut(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlPre) OnMouseOver(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlPre) OnMouseUp(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlPre) OnPaste(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("paste", h, scope...) return e } func (e *htmlPre) OnReset(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("reset", h, scope...) return e } func (e *htmlPre) OnScroll(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlPre) OnSearch(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("search", h, scope...) return e } func (e *htmlPre) OnSelect(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("select", h, scope...) return e } func (e *htmlPre) OnSubmit(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("submit", h, scope...) return e } func (e *htmlPre) OnWheel(h EventHandler, scope ...any) HTMLPre { e.setEventHandler("wheel", h, scope...) return e } // HTMLProgress is the interface that describes a "progress" HTML element. type HTMLProgress interface { UI // Body set the content of the element. Body(elems ...UI) HTMLProgress // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLProgress // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLProgress // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLProgress // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLProgress // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLProgress // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLProgress // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLProgress // Dir specifies the text direction for the content in an element. Dir(v string) HTMLProgress // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLProgress // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLProgress // ID specifies a unique id for an element. ID(v string) HTMLProgress // Lang specifies the language of the element's content. Lang(v string) HTMLProgress // Max Specifies the maximum value. Max(v any) HTMLProgress // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLProgress // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLProgress // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLProgress // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLProgress // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLProgress // Title specifies extra information about an element. Title(v string) HTMLProgress // Value specifies the value of the element. Value(v any) HTMLProgress // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLProgress // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLProgress // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLProgress // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLProgress // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLProgress // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLProgress // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLProgress // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLProgress // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLProgress // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLProgress // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLProgress // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLProgress // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLProgress // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLProgress // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLProgress // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLProgress // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLProgress // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLProgress // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLProgress // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLProgress // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLProgress // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLProgress // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLProgress // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLProgress // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLProgress // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLProgress // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLProgress // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLProgress // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLProgress // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLProgress // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLProgress // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLProgress // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLProgress } // Progress returns an HTML element that represents the progress of a task. func Progress() HTMLProgress { e := &htmlProgress{ htmlElement: htmlElement{ tag: "progress", isSelfClosing: false, }, } return e } type htmlProgress struct { htmlElement } func (e *htmlProgress) Body(v ...UI) HTMLProgress { e.setChildren(v...) return e } func (e *htmlProgress) Text(v any) HTMLProgress { return e.Body(Text(v)) } func (e *htmlProgress) AccessKey(v string) HTMLProgress { e.setAttr("accesskey", v) return e } func (e *htmlProgress) Aria(k string, v any) HTMLProgress { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlProgress) Attr(n string, v any) HTMLProgress { e.setAttr(n, v) return e } func (e *htmlProgress) Class(v ...string) HTMLProgress { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlProgress) ContentEditable(v bool) HTMLProgress { e.setAttr("contenteditable", v) return e } func (e *htmlProgress) DataSet(k string, v any) HTMLProgress { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlProgress) Dir(v string) HTMLProgress { e.setAttr("dir", v) return e } func (e *htmlProgress) Draggable(v bool) HTMLProgress { e.setAttr("draggable", v) return e } func (e *htmlProgress) Hidden(v bool) HTMLProgress { e.setAttr("hidden", v) return e } func (e *htmlProgress) ID(v string) HTMLProgress { e.setAttr("id", v) return e } func (e *htmlProgress) Lang(v string) HTMLProgress { e.setAttr("lang", v) return e } func (e *htmlProgress) Max(v any) HTMLProgress { e.setAttr("max", v) return e } func (e *htmlProgress) Role(v string) HTMLProgress { e.setAttr("role", v) return e } func (e *htmlProgress) Spellcheck(v bool) HTMLProgress { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlProgress) Style(k, v string) HTMLProgress { e.setAttr("style", k+":"+v) return e } func (e *htmlProgress) Styles(s map[string]string) HTMLProgress { for k, v := range s { e.Style(k, v) } return e } func (e *htmlProgress) TabIndex(v int) HTMLProgress { e.setAttr("tabindex", v) return e } func (e *htmlProgress) Title(v string) HTMLProgress { e.setAttr("title", v) return e } func (e *htmlProgress) Value(v any) HTMLProgress { e.setAttr("value", v) return e } func (e *htmlProgress) On(event string, h EventHandler, scope ...any) HTMLProgress { e.setEventHandler(event, h, scope...) return e } func (e *htmlProgress) OnBlur(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("blur", h, scope...) return e } func (e *htmlProgress) OnChange(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("change", h, scope...) return e } func (e *htmlProgress) OnClick(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("click", h, scope...) return e } func (e *htmlProgress) OnContextMenu(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlProgress) OnCopy(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("copy", h, scope...) return e } func (e *htmlProgress) OnCut(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("cut", h, scope...) return e } func (e *htmlProgress) OnDblClick(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlProgress) OnDrag(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("drag", h, scope...) return e } func (e *htmlProgress) OnDragEnd(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlProgress) OnDragEnter(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlProgress) OnDragLeave(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlProgress) OnDragOver(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlProgress) OnDragStart(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlProgress) OnDrop(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("drop", h, scope...) return e } func (e *htmlProgress) OnFocus(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("focus", h, scope...) return e } func (e *htmlProgress) OnInput(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("input", h, scope...) return e } func (e *htmlProgress) OnInvalid(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlProgress) OnKeyDown(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlProgress) OnKeyPress(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlProgress) OnKeyUp(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlProgress) OnMouseDown(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlProgress) OnMouseMove(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlProgress) OnMouseOut(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlProgress) OnMouseOver(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlProgress) OnMouseUp(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlProgress) OnPaste(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("paste", h, scope...) return e } func (e *htmlProgress) OnReset(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("reset", h, scope...) return e } func (e *htmlProgress) OnScroll(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlProgress) OnSearch(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("search", h, scope...) return e } func (e *htmlProgress) OnSelect(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("select", h, scope...) return e } func (e *htmlProgress) OnSubmit(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("submit", h, scope...) return e } func (e *htmlProgress) OnWheel(h EventHandler, scope ...any) HTMLProgress { e.setEventHandler("wheel", h, scope...) return e } // HTMLQ is the interface that describes a "q" HTML element. type HTMLQ interface { UI // Body set the content of the element. Body(elems ...UI) HTMLQ // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLQ // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLQ // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLQ // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLQ // Cite specifies a URL which explains the quote/deleted/inserted text. Cite(v string) HTMLQ // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLQ // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLQ // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLQ // Dir specifies the text direction for the content in an element. Dir(v string) HTMLQ // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLQ // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLQ // ID specifies a unique id for an element. ID(v string) HTMLQ // Lang specifies the language of the element's content. Lang(v string) HTMLQ // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLQ // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLQ // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLQ // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLQ // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLQ // Title specifies extra information about an element. Title(v string) HTMLQ // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLQ // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLQ // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLQ // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLQ // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLQ // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLQ // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLQ // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLQ // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLQ // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLQ // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLQ // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLQ // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLQ // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLQ // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLQ // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLQ // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLQ // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLQ // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLQ // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLQ // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLQ // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLQ // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLQ // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLQ // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLQ // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLQ // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLQ // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLQ // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLQ // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLQ // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLQ // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLQ // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLQ } // Q returns an HTML element that defines a short quotation. func Q() HTMLQ { e := &htmlQ{ htmlElement: htmlElement{ tag: "q", isSelfClosing: false, }, } return e } type htmlQ struct { htmlElement } func (e *htmlQ) Body(v ...UI) HTMLQ { e.setChildren(v...) return e } func (e *htmlQ) Text(v any) HTMLQ { return e.Body(Text(v)) } func (e *htmlQ) AccessKey(v string) HTMLQ { e.setAttr("accesskey", v) return e } func (e *htmlQ) Aria(k string, v any) HTMLQ { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlQ) Attr(n string, v any) HTMLQ { e.setAttr(n, v) return e } func (e *htmlQ) Cite(v string) HTMLQ { e.setAttr("cite", v) return e } func (e *htmlQ) Class(v ...string) HTMLQ { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlQ) ContentEditable(v bool) HTMLQ { e.setAttr("contenteditable", v) return e } func (e *htmlQ) DataSet(k string, v any) HTMLQ { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlQ) Dir(v string) HTMLQ { e.setAttr("dir", v) return e } func (e *htmlQ) Draggable(v bool) HTMLQ { e.setAttr("draggable", v) return e } func (e *htmlQ) Hidden(v bool) HTMLQ { e.setAttr("hidden", v) return e } func (e *htmlQ) ID(v string) HTMLQ { e.setAttr("id", v) return e } func (e *htmlQ) Lang(v string) HTMLQ { e.setAttr("lang", v) return e } func (e *htmlQ) Role(v string) HTMLQ { e.setAttr("role", v) return e } func (e *htmlQ) Spellcheck(v bool) HTMLQ { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlQ) Style(k, v string) HTMLQ { e.setAttr("style", k+":"+v) return e } func (e *htmlQ) Styles(s map[string]string) HTMLQ { for k, v := range s { e.Style(k, v) } return e } func (e *htmlQ) TabIndex(v int) HTMLQ { e.setAttr("tabindex", v) return e } func (e *htmlQ) Title(v string) HTMLQ { e.setAttr("title", v) return e } func (e *htmlQ) On(event string, h EventHandler, scope ...any) HTMLQ { e.setEventHandler(event, h, scope...) return e } func (e *htmlQ) OnBlur(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("blur", h, scope...) return e } func (e *htmlQ) OnChange(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("change", h, scope...) return e } func (e *htmlQ) OnClick(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("click", h, scope...) return e } func (e *htmlQ) OnContextMenu(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlQ) OnCopy(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("copy", h, scope...) return e } func (e *htmlQ) OnCut(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("cut", h, scope...) return e } func (e *htmlQ) OnDblClick(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlQ) OnDrag(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("drag", h, scope...) return e } func (e *htmlQ) OnDragEnd(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlQ) OnDragEnter(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlQ) OnDragLeave(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlQ) OnDragOver(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlQ) OnDragStart(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlQ) OnDrop(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("drop", h, scope...) return e } func (e *htmlQ) OnFocus(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("focus", h, scope...) return e } func (e *htmlQ) OnInput(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("input", h, scope...) return e } func (e *htmlQ) OnInvalid(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlQ) OnKeyDown(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlQ) OnKeyPress(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlQ) OnKeyUp(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlQ) OnMouseDown(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlQ) OnMouseMove(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlQ) OnMouseOut(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlQ) OnMouseOver(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlQ) OnMouseUp(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlQ) OnPaste(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("paste", h, scope...) return e } func (e *htmlQ) OnReset(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("reset", h, scope...) return e } func (e *htmlQ) OnScroll(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlQ) OnSearch(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("search", h, scope...) return e } func (e *htmlQ) OnSelect(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("select", h, scope...) return e } func (e *htmlQ) OnSubmit(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("submit", h, scope...) return e } func (e *htmlQ) OnWheel(h EventHandler, scope ...any) HTMLQ { e.setEventHandler("wheel", h, scope...) return e } // HTMLRp is the interface that describes a "rp" HTML element. type HTMLRp interface { UI // Body set the content of the element. Body(elems ...UI) HTMLRp // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLRp // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLRp // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLRp // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLRp // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLRp // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLRp // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLRp // Dir specifies the text direction for the content in an element. Dir(v string) HTMLRp // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLRp // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLRp // ID specifies a unique id for an element. ID(v string) HTMLRp // Lang specifies the language of the element's content. Lang(v string) HTMLRp // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLRp // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLRp // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLRp // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLRp // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLRp // Title specifies extra information about an element. Title(v string) HTMLRp // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLRp // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLRp // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLRp // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLRp // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLRp // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLRp // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLRp // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLRp // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLRp // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLRp // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLRp // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLRp // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLRp // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLRp // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLRp // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLRp // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLRp // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLRp // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLRp // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLRp // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLRp // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLRp // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLRp // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLRp // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLRp // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLRp // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLRp // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLRp // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLRp // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLRp // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLRp // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLRp // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLRp } // Rp returns an HTML element that defines what to show in browsers that do not support ruby annotations. func Rp() HTMLRp { e := &htmlRp{ htmlElement: htmlElement{ tag: "rp", isSelfClosing: false, }, } return e } type htmlRp struct { htmlElement } func (e *htmlRp) Body(v ...UI) HTMLRp { e.setChildren(v...) return e } func (e *htmlRp) Text(v any) HTMLRp { return e.Body(Text(v)) } func (e *htmlRp) AccessKey(v string) HTMLRp { e.setAttr("accesskey", v) return e } func (e *htmlRp) Aria(k string, v any) HTMLRp { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRp) Attr(n string, v any) HTMLRp { e.setAttr(n, v) return e } func (e *htmlRp) Class(v ...string) HTMLRp { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlRp) ContentEditable(v bool) HTMLRp { e.setAttr("contenteditable", v) return e } func (e *htmlRp) DataSet(k string, v any) HTMLRp { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRp) Dir(v string) HTMLRp { e.setAttr("dir", v) return e } func (e *htmlRp) Draggable(v bool) HTMLRp { e.setAttr("draggable", v) return e } func (e *htmlRp) Hidden(v bool) HTMLRp { e.setAttr("hidden", v) return e } func (e *htmlRp) ID(v string) HTMLRp { e.setAttr("id", v) return e } func (e *htmlRp) Lang(v string) HTMLRp { e.setAttr("lang", v) return e } func (e *htmlRp) Role(v string) HTMLRp { e.setAttr("role", v) return e } func (e *htmlRp) Spellcheck(v bool) HTMLRp { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlRp) Style(k, v string) HTMLRp { e.setAttr("style", k+":"+v) return e } func (e *htmlRp) Styles(s map[string]string) HTMLRp { for k, v := range s { e.Style(k, v) } return e } func (e *htmlRp) TabIndex(v int) HTMLRp { e.setAttr("tabindex", v) return e } func (e *htmlRp) Title(v string) HTMLRp { e.setAttr("title", v) return e } func (e *htmlRp) On(event string, h EventHandler, scope ...any) HTMLRp { e.setEventHandler(event, h, scope...) return e } func (e *htmlRp) OnBlur(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("blur", h, scope...) return e } func (e *htmlRp) OnChange(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("change", h, scope...) return e } func (e *htmlRp) OnClick(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("click", h, scope...) return e } func (e *htmlRp) OnContextMenu(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlRp) OnCopy(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("copy", h, scope...) return e } func (e *htmlRp) OnCut(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("cut", h, scope...) return e } func (e *htmlRp) OnDblClick(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlRp) OnDrag(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("drag", h, scope...) return e } func (e *htmlRp) OnDragEnd(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlRp) OnDragEnter(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlRp) OnDragLeave(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlRp) OnDragOver(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlRp) OnDragStart(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlRp) OnDrop(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("drop", h, scope...) return e } func (e *htmlRp) OnFocus(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("focus", h, scope...) return e } func (e *htmlRp) OnInput(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("input", h, scope...) return e } func (e *htmlRp) OnInvalid(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlRp) OnKeyDown(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlRp) OnKeyPress(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlRp) OnKeyUp(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlRp) OnMouseDown(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlRp) OnMouseMove(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlRp) OnMouseOut(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlRp) OnMouseOver(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlRp) OnMouseUp(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlRp) OnPaste(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("paste", h, scope...) return e } func (e *htmlRp) OnReset(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("reset", h, scope...) return e } func (e *htmlRp) OnScroll(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlRp) OnSearch(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("search", h, scope...) return e } func (e *htmlRp) OnSelect(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("select", h, scope...) return e } func (e *htmlRp) OnSubmit(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("submit", h, scope...) return e } func (e *htmlRp) OnWheel(h EventHandler, scope ...any) HTMLRp { e.setEventHandler("wheel", h, scope...) return e } // HTMLRt is the interface that describes a "rt" HTML element. type HTMLRt interface { UI // Body set the content of the element. Body(elems ...UI) HTMLRt // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLRt // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLRt // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLRt // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLRt // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLRt // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLRt // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLRt // Dir specifies the text direction for the content in an element. Dir(v string) HTMLRt // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLRt // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLRt // ID specifies a unique id for an element. ID(v string) HTMLRt // Lang specifies the language of the element's content. Lang(v string) HTMLRt // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLRt // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLRt // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLRt // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLRt // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLRt // Title specifies extra information about an element. Title(v string) HTMLRt // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLRt // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLRt // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLRt // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLRt // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLRt // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLRt // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLRt // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLRt // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLRt // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLRt // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLRt // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLRt // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLRt // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLRt // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLRt // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLRt // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLRt // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLRt // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLRt // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLRt // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLRt // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLRt // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLRt // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLRt // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLRt // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLRt // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLRt // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLRt // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLRt // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLRt // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLRt // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLRt // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLRt } // Rt returns an HTML element that defines an explanation/pronunciation of characters (for East Asian typography). func Rt() HTMLRt { e := &htmlRt{ htmlElement: htmlElement{ tag: "rt", isSelfClosing: false, }, } return e } type htmlRt struct { htmlElement } func (e *htmlRt) Body(v ...UI) HTMLRt { e.setChildren(v...) return e } func (e *htmlRt) Text(v any) HTMLRt { return e.Body(Text(v)) } func (e *htmlRt) AccessKey(v string) HTMLRt { e.setAttr("accesskey", v) return e } func (e *htmlRt) Aria(k string, v any) HTMLRt { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRt) Attr(n string, v any) HTMLRt { e.setAttr(n, v) return e } func (e *htmlRt) Class(v ...string) HTMLRt { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlRt) ContentEditable(v bool) HTMLRt { e.setAttr("contenteditable", v) return e } func (e *htmlRt) DataSet(k string, v any) HTMLRt { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRt) Dir(v string) HTMLRt { e.setAttr("dir", v) return e } func (e *htmlRt) Draggable(v bool) HTMLRt { e.setAttr("draggable", v) return e } func (e *htmlRt) Hidden(v bool) HTMLRt { e.setAttr("hidden", v) return e } func (e *htmlRt) ID(v string) HTMLRt { e.setAttr("id", v) return e } func (e *htmlRt) Lang(v string) HTMLRt { e.setAttr("lang", v) return e } func (e *htmlRt) Role(v string) HTMLRt { e.setAttr("role", v) return e } func (e *htmlRt) Spellcheck(v bool) HTMLRt { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlRt) Style(k, v string) HTMLRt { e.setAttr("style", k+":"+v) return e } func (e *htmlRt) Styles(s map[string]string) HTMLRt { for k, v := range s { e.Style(k, v) } return e } func (e *htmlRt) TabIndex(v int) HTMLRt { e.setAttr("tabindex", v) return e } func (e *htmlRt) Title(v string) HTMLRt { e.setAttr("title", v) return e } func (e *htmlRt) On(event string, h EventHandler, scope ...any) HTMLRt { e.setEventHandler(event, h, scope...) return e } func (e *htmlRt) OnBlur(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("blur", h, scope...) return e } func (e *htmlRt) OnChange(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("change", h, scope...) return e } func (e *htmlRt) OnClick(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("click", h, scope...) return e } func (e *htmlRt) OnContextMenu(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlRt) OnCopy(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("copy", h, scope...) return e } func (e *htmlRt) OnCut(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("cut", h, scope...) return e } func (e *htmlRt) OnDblClick(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlRt) OnDrag(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("drag", h, scope...) return e } func (e *htmlRt) OnDragEnd(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlRt) OnDragEnter(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlRt) OnDragLeave(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlRt) OnDragOver(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlRt) OnDragStart(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlRt) OnDrop(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("drop", h, scope...) return e } func (e *htmlRt) OnFocus(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("focus", h, scope...) return e } func (e *htmlRt) OnInput(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("input", h, scope...) return e } func (e *htmlRt) OnInvalid(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlRt) OnKeyDown(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlRt) OnKeyPress(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlRt) OnKeyUp(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlRt) OnMouseDown(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlRt) OnMouseMove(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlRt) OnMouseOut(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlRt) OnMouseOver(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlRt) OnMouseUp(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlRt) OnPaste(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("paste", h, scope...) return e } func (e *htmlRt) OnReset(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("reset", h, scope...) return e } func (e *htmlRt) OnScroll(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlRt) OnSearch(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("search", h, scope...) return e } func (e *htmlRt) OnSelect(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("select", h, scope...) return e } func (e *htmlRt) OnSubmit(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("submit", h, scope...) return e } func (e *htmlRt) OnWheel(h EventHandler, scope ...any) HTMLRt { e.setEventHandler("wheel", h, scope...) return e } // HTMLRuby is the interface that describes a "ruby" HTML element. type HTMLRuby interface { UI // Body set the content of the element. Body(elems ...UI) HTMLRuby // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLRuby // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLRuby // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLRuby // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLRuby // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLRuby // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLRuby // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLRuby // Dir specifies the text direction for the content in an element. Dir(v string) HTMLRuby // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLRuby // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLRuby // ID specifies a unique id for an element. ID(v string) HTMLRuby // Lang specifies the language of the element's content. Lang(v string) HTMLRuby // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLRuby // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLRuby // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLRuby // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLRuby // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLRuby // Title specifies extra information about an element. Title(v string) HTMLRuby // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLRuby // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLRuby // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLRuby // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLRuby // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLRuby // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLRuby // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLRuby // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLRuby // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLRuby // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLRuby // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLRuby // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLRuby // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLRuby // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLRuby // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLRuby // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLRuby // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLRuby // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLRuby // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLRuby // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLRuby // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLRuby // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLRuby // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLRuby // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLRuby // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLRuby // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLRuby // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLRuby // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLRuby // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLRuby // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLRuby // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLRuby // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLRuby // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLRuby } // Ruby returns an HTML element that defines a ruby annotation (for East Asian typography). func Ruby() HTMLRuby { e := &htmlRuby{ htmlElement: htmlElement{ tag: "ruby", isSelfClosing: false, }, } return e } type htmlRuby struct { htmlElement } func (e *htmlRuby) Body(v ...UI) HTMLRuby { e.setChildren(v...) return e } func (e *htmlRuby) Text(v any) HTMLRuby { return e.Body(Text(v)) } func (e *htmlRuby) AccessKey(v string) HTMLRuby { e.setAttr("accesskey", v) return e } func (e *htmlRuby) Aria(k string, v any) HTMLRuby { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRuby) Attr(n string, v any) HTMLRuby { e.setAttr(n, v) return e } func (e *htmlRuby) Class(v ...string) HTMLRuby { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlRuby) ContentEditable(v bool) HTMLRuby { e.setAttr("contenteditable", v) return e } func (e *htmlRuby) DataSet(k string, v any) HTMLRuby { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlRuby) Dir(v string) HTMLRuby { e.setAttr("dir", v) return e } func (e *htmlRuby) Draggable(v bool) HTMLRuby { e.setAttr("draggable", v) return e } func (e *htmlRuby) Hidden(v bool) HTMLRuby { e.setAttr("hidden", v) return e } func (e *htmlRuby) ID(v string) HTMLRuby { e.setAttr("id", v) return e } func (e *htmlRuby) Lang(v string) HTMLRuby { e.setAttr("lang", v) return e } func (e *htmlRuby) Role(v string) HTMLRuby { e.setAttr("role", v) return e } func (e *htmlRuby) Spellcheck(v bool) HTMLRuby { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlRuby) Style(k, v string) HTMLRuby { e.setAttr("style", k+":"+v) return e } func (e *htmlRuby) Styles(s map[string]string) HTMLRuby { for k, v := range s { e.Style(k, v) } return e } func (e *htmlRuby) TabIndex(v int) HTMLRuby { e.setAttr("tabindex", v) return e } func (e *htmlRuby) Title(v string) HTMLRuby { e.setAttr("title", v) return e } func (e *htmlRuby) On(event string, h EventHandler, scope ...any) HTMLRuby { e.setEventHandler(event, h, scope...) return e } func (e *htmlRuby) OnBlur(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("blur", h, scope...) return e } func (e *htmlRuby) OnChange(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("change", h, scope...) return e } func (e *htmlRuby) OnClick(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("click", h, scope...) return e } func (e *htmlRuby) OnContextMenu(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlRuby) OnCopy(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("copy", h, scope...) return e } func (e *htmlRuby) OnCut(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("cut", h, scope...) return e } func (e *htmlRuby) OnDblClick(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlRuby) OnDrag(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("drag", h, scope...) return e } func (e *htmlRuby) OnDragEnd(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlRuby) OnDragEnter(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlRuby) OnDragLeave(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlRuby) OnDragOver(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlRuby) OnDragStart(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlRuby) OnDrop(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("drop", h, scope...) return e } func (e *htmlRuby) OnFocus(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("focus", h, scope...) return e } func (e *htmlRuby) OnInput(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("input", h, scope...) return e } func (e *htmlRuby) OnInvalid(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlRuby) OnKeyDown(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlRuby) OnKeyPress(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlRuby) OnKeyUp(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlRuby) OnMouseDown(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlRuby) OnMouseMove(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlRuby) OnMouseOut(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlRuby) OnMouseOver(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlRuby) OnMouseUp(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlRuby) OnPaste(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("paste", h, scope...) return e } func (e *htmlRuby) OnReset(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("reset", h, scope...) return e } func (e *htmlRuby) OnScroll(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlRuby) OnSearch(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("search", h, scope...) return e } func (e *htmlRuby) OnSelect(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("select", h, scope...) return e } func (e *htmlRuby) OnSubmit(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("submit", h, scope...) return e } func (e *htmlRuby) OnWheel(h EventHandler, scope ...any) HTMLRuby { e.setEventHandler("wheel", h, scope...) return e } // HTMLS is the interface that describes a "s" HTML element. type HTMLS interface { UI // Body set the content of the element. Body(elems ...UI) HTMLS // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLS // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLS // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLS // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLS // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLS // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLS // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLS // Dir specifies the text direction for the content in an element. Dir(v string) HTMLS // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLS // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLS // ID specifies a unique id for an element. ID(v string) HTMLS // Lang specifies the language of the element's content. Lang(v string) HTMLS // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLS // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLS // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLS // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLS // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLS // Title specifies extra information about an element. Title(v string) HTMLS // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLS // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLS // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLS // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLS // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLS // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLS // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLS // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLS // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLS // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLS // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLS // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLS // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLS // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLS // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLS // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLS // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLS // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLS // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLS // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLS // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLS // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLS // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLS // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLS // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLS // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLS // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLS // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLS // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLS // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLS // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLS // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLS // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLS } // S returns an HTML element that Defines text that is no longer correct. func S() HTMLS { e := &htmlS{ htmlElement: htmlElement{ tag: "s", isSelfClosing: false, }, } return e } type htmlS struct { htmlElement } func (e *htmlS) Body(v ...UI) HTMLS { e.setChildren(v...) return e } func (e *htmlS) Text(v any) HTMLS { return e.Body(Text(v)) } func (e *htmlS) AccessKey(v string) HTMLS { e.setAttr("accesskey", v) return e } func (e *htmlS) Aria(k string, v any) HTMLS { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlS) Attr(n string, v any) HTMLS { e.setAttr(n, v) return e } func (e *htmlS) Class(v ...string) HTMLS { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlS) ContentEditable(v bool) HTMLS { e.setAttr("contenteditable", v) return e } func (e *htmlS) DataSet(k string, v any) HTMLS { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlS) Dir(v string) HTMLS { e.setAttr("dir", v) return e } func (e *htmlS) Draggable(v bool) HTMLS { e.setAttr("draggable", v) return e } func (e *htmlS) Hidden(v bool) HTMLS { e.setAttr("hidden", v) return e } func (e *htmlS) ID(v string) HTMLS { e.setAttr("id", v) return e } func (e *htmlS) Lang(v string) HTMLS { e.setAttr("lang", v) return e } func (e *htmlS) Role(v string) HTMLS { e.setAttr("role", v) return e } func (e *htmlS) Spellcheck(v bool) HTMLS { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlS) Style(k, v string) HTMLS { e.setAttr("style", k+":"+v) return e } func (e *htmlS) Styles(s map[string]string) HTMLS { for k, v := range s { e.Style(k, v) } return e } func (e *htmlS) TabIndex(v int) HTMLS { e.setAttr("tabindex", v) return e } func (e *htmlS) Title(v string) HTMLS { e.setAttr("title", v) return e } func (e *htmlS) On(event string, h EventHandler, scope ...any) HTMLS { e.setEventHandler(event, h, scope...) return e } func (e *htmlS) OnBlur(h EventHandler, scope ...any) HTMLS { e.setEventHandler("blur", h, scope...) return e } func (e *htmlS) OnChange(h EventHandler, scope ...any) HTMLS { e.setEventHandler("change", h, scope...) return e } func (e *htmlS) OnClick(h EventHandler, scope ...any) HTMLS { e.setEventHandler("click", h, scope...) return e } func (e *htmlS) OnContextMenu(h EventHandler, scope ...any) HTMLS { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlS) OnCopy(h EventHandler, scope ...any) HTMLS { e.setEventHandler("copy", h, scope...) return e } func (e *htmlS) OnCut(h EventHandler, scope ...any) HTMLS { e.setEventHandler("cut", h, scope...) return e } func (e *htmlS) OnDblClick(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlS) OnDrag(h EventHandler, scope ...any) HTMLS { e.setEventHandler("drag", h, scope...) return e } func (e *htmlS) OnDragEnd(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlS) OnDragEnter(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlS) OnDragLeave(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlS) OnDragOver(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlS) OnDragStart(h EventHandler, scope ...any) HTMLS { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlS) OnDrop(h EventHandler, scope ...any) HTMLS { e.setEventHandler("drop", h, scope...) return e } func (e *htmlS) OnFocus(h EventHandler, scope ...any) HTMLS { e.setEventHandler("focus", h, scope...) return e } func (e *htmlS) OnInput(h EventHandler, scope ...any) HTMLS { e.setEventHandler("input", h, scope...) return e } func (e *htmlS) OnInvalid(h EventHandler, scope ...any) HTMLS { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlS) OnKeyDown(h EventHandler, scope ...any) HTMLS { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlS) OnKeyPress(h EventHandler, scope ...any) HTMLS { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlS) OnKeyUp(h EventHandler, scope ...any) HTMLS { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlS) OnMouseDown(h EventHandler, scope ...any) HTMLS { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlS) OnMouseMove(h EventHandler, scope ...any) HTMLS { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlS) OnMouseOut(h EventHandler, scope ...any) HTMLS { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlS) OnMouseOver(h EventHandler, scope ...any) HTMLS { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlS) OnMouseUp(h EventHandler, scope ...any) HTMLS { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlS) OnPaste(h EventHandler, scope ...any) HTMLS { e.setEventHandler("paste", h, scope...) return e } func (e *htmlS) OnReset(h EventHandler, scope ...any) HTMLS { e.setEventHandler("reset", h, scope...) return e } func (e *htmlS) OnScroll(h EventHandler, scope ...any) HTMLS { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlS) OnSearch(h EventHandler, scope ...any) HTMLS { e.setEventHandler("search", h, scope...) return e } func (e *htmlS) OnSelect(h EventHandler, scope ...any) HTMLS { e.setEventHandler("select", h, scope...) return e } func (e *htmlS) OnSubmit(h EventHandler, scope ...any) HTMLS { e.setEventHandler("submit", h, scope...) return e } func (e *htmlS) OnWheel(h EventHandler, scope ...any) HTMLS { e.setEventHandler("wheel", h, scope...) return e } // HTMLSamp is the interface that describes a "samp" HTML element. type HTMLSamp interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSamp // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSamp // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSamp // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSamp // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSamp // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSamp // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSamp // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSamp // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSamp // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSamp // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSamp // ID specifies a unique id for an element. ID(v string) HTMLSamp // Lang specifies the language of the element's content. Lang(v string) HTMLSamp // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSamp // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSamp // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSamp // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSamp // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSamp // Title specifies extra information about an element. Title(v string) HTMLSamp // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSamp // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSamp // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSamp // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSamp // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSamp // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSamp // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSamp // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSamp // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSamp // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSamp // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSamp // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSamp // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSamp // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSamp // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSamp // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSamp // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSamp // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSamp // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSamp // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSamp // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSamp // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSamp // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSamp // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSamp // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSamp // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSamp // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSamp // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSamp // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSamp // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSamp // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSamp // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSamp // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSamp } // Samp returns an HTML element that defines sample output from a computer program. func Samp() HTMLSamp { e := &htmlSamp{ htmlElement: htmlElement{ tag: "samp", isSelfClosing: false, }, } return e } type htmlSamp struct { htmlElement } func (e *htmlSamp) Body(v ...UI) HTMLSamp { e.setChildren(v...) return e } func (e *htmlSamp) Text(v any) HTMLSamp { return e.Body(Text(v)) } func (e *htmlSamp) AccessKey(v string) HTMLSamp { e.setAttr("accesskey", v) return e } func (e *htmlSamp) Aria(k string, v any) HTMLSamp { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSamp) Attr(n string, v any) HTMLSamp { e.setAttr(n, v) return e } func (e *htmlSamp) Class(v ...string) HTMLSamp { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSamp) ContentEditable(v bool) HTMLSamp { e.setAttr("contenteditable", v) return e } func (e *htmlSamp) DataSet(k string, v any) HTMLSamp { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSamp) Dir(v string) HTMLSamp { e.setAttr("dir", v) return e } func (e *htmlSamp) Draggable(v bool) HTMLSamp { e.setAttr("draggable", v) return e } func (e *htmlSamp) Hidden(v bool) HTMLSamp { e.setAttr("hidden", v) return e } func (e *htmlSamp) ID(v string) HTMLSamp { e.setAttr("id", v) return e } func (e *htmlSamp) Lang(v string) HTMLSamp { e.setAttr("lang", v) return e } func (e *htmlSamp) Role(v string) HTMLSamp { e.setAttr("role", v) return e } func (e *htmlSamp) Spellcheck(v bool) HTMLSamp { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSamp) Style(k, v string) HTMLSamp { e.setAttr("style", k+":"+v) return e } func (e *htmlSamp) Styles(s map[string]string) HTMLSamp { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSamp) TabIndex(v int) HTMLSamp { e.setAttr("tabindex", v) return e } func (e *htmlSamp) Title(v string) HTMLSamp { e.setAttr("title", v) return e } func (e *htmlSamp) On(event string, h EventHandler, scope ...any) HTMLSamp { e.setEventHandler(event, h, scope...) return e } func (e *htmlSamp) OnBlur(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSamp) OnChange(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("change", h, scope...) return e } func (e *htmlSamp) OnClick(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("click", h, scope...) return e } func (e *htmlSamp) OnContextMenu(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSamp) OnCopy(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSamp) OnCut(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSamp) OnDblClick(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSamp) OnDrag(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSamp) OnDragEnd(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSamp) OnDragEnter(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSamp) OnDragLeave(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSamp) OnDragOver(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSamp) OnDragStart(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSamp) OnDrop(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSamp) OnFocus(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSamp) OnInput(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("input", h, scope...) return e } func (e *htmlSamp) OnInvalid(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSamp) OnKeyDown(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSamp) OnKeyPress(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSamp) OnKeyUp(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSamp) OnMouseDown(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSamp) OnMouseMove(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSamp) OnMouseOut(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSamp) OnMouseOver(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSamp) OnMouseUp(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSamp) OnPaste(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSamp) OnReset(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSamp) OnScroll(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSamp) OnSearch(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("search", h, scope...) return e } func (e *htmlSamp) OnSelect(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("select", h, scope...) return e } func (e *htmlSamp) OnSubmit(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSamp) OnWheel(h EventHandler, scope ...any) HTMLSamp { e.setEventHandler("wheel", h, scope...) return e } // HTMLScript is the interface that describes a "script" HTML element. type HTMLScript interface { UI // Body set the content of the element. Body(elems ...UI) HTMLScript // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLScript // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLScript // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLScript // Async specifies that the script is executed asynchronously (only for external scripts). Async(v bool) HTMLScript // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLScript // Charset specifies the character encoding. Charset(v string) HTMLScript // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLScript // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLScript // CrossOrigin sets the mode of the request to an HTTP CORS Request. CrossOrigin(v string) HTMLScript // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLScript // Defer specifies that the script is executed when the page has finished parsing (only for external scripts). Defer(v bool) HTMLScript // Dir specifies the text direction for the content in an element. Dir(v string) HTMLScript // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLScript // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLScript // ID specifies a unique id for an element. ID(v string) HTMLScript // Lang specifies the language of the element's content. Lang(v string) HTMLScript // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLScript // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLScript // Src specifies the URL of the media file. Src(v string) HTMLScript // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLScript // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLScript // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLScript // Title specifies extra information about an element. Title(v string) HTMLScript // Type specifies the type of element. Type(v string) HTMLScript // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLScript // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLScript } // Script returns an HTML element that defines a client-side script. func Script() HTMLScript { e := &htmlScript{ htmlElement: htmlElement{ tag: "script", isSelfClosing: false, }, } return e } type htmlScript struct { htmlElement } func (e *htmlScript) Body(v ...UI) HTMLScript { e.setChildren(v...) return e } func (e *htmlScript) Text(v any) HTMLScript { return e.Body(Text(v)) } func (e *htmlScript) AccessKey(v string) HTMLScript { e.setAttr("accesskey", v) return e } func (e *htmlScript) Aria(k string, v any) HTMLScript { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlScript) Async(v bool) HTMLScript { e.setAttr("async", v) return e } func (e *htmlScript) Attr(n string, v any) HTMLScript { e.setAttr(n, v) return e } func (e *htmlScript) Charset(v string) HTMLScript { e.setAttr("charset", v) return e } func (e *htmlScript) Class(v ...string) HTMLScript { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlScript) ContentEditable(v bool) HTMLScript { e.setAttr("contenteditable", v) return e } func (e *htmlScript) CrossOrigin(v string) HTMLScript { e.setAttr("crossorigin", v) return e } func (e *htmlScript) DataSet(k string, v any) HTMLScript { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlScript) Defer(v bool) HTMLScript { e.setAttr("defer", v) return e } func (e *htmlScript) Dir(v string) HTMLScript { e.setAttr("dir", v) return e } func (e *htmlScript) Draggable(v bool) HTMLScript { e.setAttr("draggable", v) return e } func (e *htmlScript) Hidden(v bool) HTMLScript { e.setAttr("hidden", v) return e } func (e *htmlScript) ID(v string) HTMLScript { e.setAttr("id", v) return e } func (e *htmlScript) Lang(v string) HTMLScript { e.setAttr("lang", v) return e } func (e *htmlScript) Role(v string) HTMLScript { e.setAttr("role", v) return e } func (e *htmlScript) Spellcheck(v bool) HTMLScript { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlScript) Src(v string) HTMLScript { e.setAttr("src", v) return e } func (e *htmlScript) Style(k, v string) HTMLScript { e.setAttr("style", k+":"+v) return e } func (e *htmlScript) Styles(s map[string]string) HTMLScript { for k, v := range s { e.Style(k, v) } return e } func (e *htmlScript) TabIndex(v int) HTMLScript { e.setAttr("tabindex", v) return e } func (e *htmlScript) Title(v string) HTMLScript { e.setAttr("title", v) return e } func (e *htmlScript) Type(v string) HTMLScript { e.setAttr("type", v) return e } func (e *htmlScript) On(event string, h EventHandler, scope ...any) HTMLScript { e.setEventHandler(event, h, scope...) return e } func (e *htmlScript) OnLoad(h EventHandler, scope ...any) HTMLScript { e.setEventHandler("load", h, scope...) return e } // HTMLSection is the interface that describes a "section" HTML element. type HTMLSection interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSection // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSection // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSection // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSection // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSection // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSection // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSection // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSection // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSection // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSection // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSection // ID specifies a unique id for an element. ID(v string) HTMLSection // Lang specifies the language of the element's content. Lang(v string) HTMLSection // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSection // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSection // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSection // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSection // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSection // Title specifies extra information about an element. Title(v string) HTMLSection // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSection // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSection // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSection // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSection // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSection // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSection // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSection // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSection // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSection // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSection // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSection // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSection // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSection // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSection // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSection // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSection // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSection // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSection // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSection // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSection // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSection // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSection // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSection // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSection // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSection // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSection // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSection // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSection // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSection // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSection // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSection // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSection // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSection } // Section returns an HTML element that defines a section in a document. func Section() HTMLSection { e := &htmlSection{ htmlElement: htmlElement{ tag: "section", isSelfClosing: false, }, } return e } type htmlSection struct { htmlElement } func (e *htmlSection) Body(v ...UI) HTMLSection { e.setChildren(v...) return e } func (e *htmlSection) Text(v any) HTMLSection { return e.Body(Text(v)) } func (e *htmlSection) AccessKey(v string) HTMLSection { e.setAttr("accesskey", v) return e } func (e *htmlSection) Aria(k string, v any) HTMLSection { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSection) Attr(n string, v any) HTMLSection { e.setAttr(n, v) return e } func (e *htmlSection) Class(v ...string) HTMLSection { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSection) ContentEditable(v bool) HTMLSection { e.setAttr("contenteditable", v) return e } func (e *htmlSection) DataSet(k string, v any) HTMLSection { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSection) Dir(v string) HTMLSection { e.setAttr("dir", v) return e } func (e *htmlSection) Draggable(v bool) HTMLSection { e.setAttr("draggable", v) return e } func (e *htmlSection) Hidden(v bool) HTMLSection { e.setAttr("hidden", v) return e } func (e *htmlSection) ID(v string) HTMLSection { e.setAttr("id", v) return e } func (e *htmlSection) Lang(v string) HTMLSection { e.setAttr("lang", v) return e } func (e *htmlSection) Role(v string) HTMLSection { e.setAttr("role", v) return e } func (e *htmlSection) Spellcheck(v bool) HTMLSection { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSection) Style(k, v string) HTMLSection { e.setAttr("style", k+":"+v) return e } func (e *htmlSection) Styles(s map[string]string) HTMLSection { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSection) TabIndex(v int) HTMLSection { e.setAttr("tabindex", v) return e } func (e *htmlSection) Title(v string) HTMLSection { e.setAttr("title", v) return e } func (e *htmlSection) On(event string, h EventHandler, scope ...any) HTMLSection { e.setEventHandler(event, h, scope...) return e } func (e *htmlSection) OnBlur(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSection) OnChange(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("change", h, scope...) return e } func (e *htmlSection) OnClick(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("click", h, scope...) return e } func (e *htmlSection) OnContextMenu(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSection) OnCopy(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSection) OnCut(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSection) OnDblClick(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSection) OnDrag(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSection) OnDragEnd(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSection) OnDragEnter(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSection) OnDragLeave(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSection) OnDragOver(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSection) OnDragStart(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSection) OnDrop(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSection) OnFocus(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSection) OnInput(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("input", h, scope...) return e } func (e *htmlSection) OnInvalid(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSection) OnKeyDown(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSection) OnKeyPress(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSection) OnKeyUp(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSection) OnMouseDown(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSection) OnMouseMove(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSection) OnMouseOut(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSection) OnMouseOver(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSection) OnMouseUp(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSection) OnPaste(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSection) OnReset(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSection) OnScroll(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSection) OnSearch(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("search", h, scope...) return e } func (e *htmlSection) OnSelect(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("select", h, scope...) return e } func (e *htmlSection) OnSubmit(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSection) OnWheel(h EventHandler, scope ...any) HTMLSection { e.setEventHandler("wheel", h, scope...) return e } // HTMLSelect is the interface that describes a "select" HTML element. type HTMLSelect interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSelect // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSelect // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSelect // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSelect // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSelect // AutoFocus specifies that the element should automatically get focus when the page loads. AutoFocus(v bool) HTMLSelect // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSelect // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSelect // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSelect // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSelect // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLSelect // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSelect // Form specifies the name of the form the element belongs to. Form(v string) HTMLSelect // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSelect // ID specifies a unique id for an element. ID(v string) HTMLSelect // Lang specifies the language of the element's content. Lang(v string) HTMLSelect // Multiple specifies that a user can enter more than one value. Multiple(v bool) HTMLSelect // Name specifies the name of the element. Name(v string) HTMLSelect // Required specifies that the element must be filled out before submitting the form. Required(v bool) HTMLSelect // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSelect // Size specifies the width. Size(v int) HTMLSelect // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSelect // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSelect // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSelect // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSelect // Title specifies extra information about an element. Title(v string) HTMLSelect // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSelect // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSelect // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSelect // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSelect // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSelect // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSelect // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSelect // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSelect // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSelect // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSelect // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSelect // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSelect // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSelect // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSelect // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSelect // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSelect // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSelect // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSelect // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSelect // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSelect // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSelect // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSelect // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSelect // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSelect // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSelect // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSelect // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSelect // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSelect // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSelect // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSelect // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSelect // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSelect // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSelect } // Select returns an HTML element that defines a drop-down list. func Select() HTMLSelect { e := &htmlSelect{ htmlElement: htmlElement{ tag: "select", isSelfClosing: false, }, } return e } type htmlSelect struct { htmlElement } func (e *htmlSelect) Body(v ...UI) HTMLSelect { e.setChildren(v...) return e } func (e *htmlSelect) Text(v any) HTMLSelect { return e.Body(Text(v)) } func (e *htmlSelect) AccessKey(v string) HTMLSelect { e.setAttr("accesskey", v) return e } func (e *htmlSelect) Aria(k string, v any) HTMLSelect { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSelect) Attr(n string, v any) HTMLSelect { e.setAttr(n, v) return e } func (e *htmlSelect) AutoFocus(v bool) HTMLSelect { e.setAttr("autofocus", v) return e } func (e *htmlSelect) Class(v ...string) HTMLSelect { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSelect) ContentEditable(v bool) HTMLSelect { e.setAttr("contenteditable", v) return e } func (e *htmlSelect) DataSet(k string, v any) HTMLSelect { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSelect) Dir(v string) HTMLSelect { e.setAttr("dir", v) return e } func (e *htmlSelect) Disabled(v bool) HTMLSelect { e.setAttr("disabled", v) return e } func (e *htmlSelect) Draggable(v bool) HTMLSelect { e.setAttr("draggable", v) return e } func (e *htmlSelect) Form(v string) HTMLSelect { e.setAttr("form", v) return e } func (e *htmlSelect) Hidden(v bool) HTMLSelect { e.setAttr("hidden", v) return e } func (e *htmlSelect) ID(v string) HTMLSelect { e.setAttr("id", v) return e } func (e *htmlSelect) Lang(v string) HTMLSelect { e.setAttr("lang", v) return e } func (e *htmlSelect) Multiple(v bool) HTMLSelect { e.setAttr("multiple", v) return e } func (e *htmlSelect) Name(v string) HTMLSelect { e.setAttr("name", v) return e } func (e *htmlSelect) Required(v bool) HTMLSelect { e.setAttr("required", v) return e } func (e *htmlSelect) Role(v string) HTMLSelect { e.setAttr("role", v) return e } func (e *htmlSelect) Size(v int) HTMLSelect { e.setAttr("size", v) return e } func (e *htmlSelect) Spellcheck(v bool) HTMLSelect { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSelect) Style(k, v string) HTMLSelect { e.setAttr("style", k+":"+v) return e } func (e *htmlSelect) Styles(s map[string]string) HTMLSelect { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSelect) TabIndex(v int) HTMLSelect { e.setAttr("tabindex", v) return e } func (e *htmlSelect) Title(v string) HTMLSelect { e.setAttr("title", v) return e } func (e *htmlSelect) On(event string, h EventHandler, scope ...any) HTMLSelect { e.setEventHandler(event, h, scope...) return e } func (e *htmlSelect) OnBlur(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSelect) OnChange(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("change", h, scope...) return e } func (e *htmlSelect) OnClick(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("click", h, scope...) return e } func (e *htmlSelect) OnContextMenu(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSelect) OnCopy(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSelect) OnCut(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSelect) OnDblClick(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSelect) OnDrag(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSelect) OnDragEnd(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSelect) OnDragEnter(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSelect) OnDragLeave(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSelect) OnDragOver(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSelect) OnDragStart(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSelect) OnDrop(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSelect) OnFocus(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSelect) OnInput(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("input", h, scope...) return e } func (e *htmlSelect) OnInvalid(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSelect) OnKeyDown(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSelect) OnKeyPress(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSelect) OnKeyUp(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSelect) OnMouseDown(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSelect) OnMouseMove(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSelect) OnMouseOut(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSelect) OnMouseOver(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSelect) OnMouseUp(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSelect) OnPaste(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSelect) OnReset(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSelect) OnScroll(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSelect) OnSearch(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("search", h, scope...) return e } func (e *htmlSelect) OnSelect(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("select", h, scope...) return e } func (e *htmlSelect) OnSubmit(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSelect) OnWheel(h EventHandler, scope ...any) HTMLSelect { e.setEventHandler("wheel", h, scope...) return e } // HTMLSmall is the interface that describes a "small" HTML element. type HTMLSmall interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSmall // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSmall // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSmall // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSmall // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSmall // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSmall // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSmall // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSmall // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSmall // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSmall // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSmall // ID specifies a unique id for an element. ID(v string) HTMLSmall // Lang specifies the language of the element's content. Lang(v string) HTMLSmall // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSmall // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSmall // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSmall // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSmall // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSmall // Title specifies extra information about an element. Title(v string) HTMLSmall // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSmall // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSmall // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSmall // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSmall // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSmall // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSmall // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSmall // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSmall // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSmall // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSmall // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSmall // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSmall // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSmall // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSmall // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSmall // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSmall // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSmall // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSmall // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSmall // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSmall // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSmall // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSmall // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSmall // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSmall // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSmall // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSmall // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSmall // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSmall // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSmall // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSmall // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSmall // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSmall // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSmall } // Small returns an HTML element that defines smaller text. func Small() HTMLSmall { e := &htmlSmall{ htmlElement: htmlElement{ tag: "small", isSelfClosing: false, }, } return e } type htmlSmall struct { htmlElement } func (e *htmlSmall) Body(v ...UI) HTMLSmall { e.setChildren(v...) return e } func (e *htmlSmall) Text(v any) HTMLSmall { return e.Body(Text(v)) } func (e *htmlSmall) AccessKey(v string) HTMLSmall { e.setAttr("accesskey", v) return e } func (e *htmlSmall) Aria(k string, v any) HTMLSmall { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSmall) Attr(n string, v any) HTMLSmall { e.setAttr(n, v) return e } func (e *htmlSmall) Class(v ...string) HTMLSmall { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSmall) ContentEditable(v bool) HTMLSmall { e.setAttr("contenteditable", v) return e } func (e *htmlSmall) DataSet(k string, v any) HTMLSmall { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSmall) Dir(v string) HTMLSmall { e.setAttr("dir", v) return e } func (e *htmlSmall) Draggable(v bool) HTMLSmall { e.setAttr("draggable", v) return e } func (e *htmlSmall) Hidden(v bool) HTMLSmall { e.setAttr("hidden", v) return e } func (e *htmlSmall) ID(v string) HTMLSmall { e.setAttr("id", v) return e } func (e *htmlSmall) Lang(v string) HTMLSmall { e.setAttr("lang", v) return e } func (e *htmlSmall) Role(v string) HTMLSmall { e.setAttr("role", v) return e } func (e *htmlSmall) Spellcheck(v bool) HTMLSmall { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSmall) Style(k, v string) HTMLSmall { e.setAttr("style", k+":"+v) return e } func (e *htmlSmall) Styles(s map[string]string) HTMLSmall { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSmall) TabIndex(v int) HTMLSmall { e.setAttr("tabindex", v) return e } func (e *htmlSmall) Title(v string) HTMLSmall { e.setAttr("title", v) return e } func (e *htmlSmall) On(event string, h EventHandler, scope ...any) HTMLSmall { e.setEventHandler(event, h, scope...) return e } func (e *htmlSmall) OnBlur(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSmall) OnChange(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("change", h, scope...) return e } func (e *htmlSmall) OnClick(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("click", h, scope...) return e } func (e *htmlSmall) OnContextMenu(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSmall) OnCopy(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSmall) OnCut(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSmall) OnDblClick(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSmall) OnDrag(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSmall) OnDragEnd(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSmall) OnDragEnter(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSmall) OnDragLeave(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSmall) OnDragOver(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSmall) OnDragStart(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSmall) OnDrop(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSmall) OnFocus(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSmall) OnInput(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("input", h, scope...) return e } func (e *htmlSmall) OnInvalid(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSmall) OnKeyDown(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSmall) OnKeyPress(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSmall) OnKeyUp(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSmall) OnMouseDown(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSmall) OnMouseMove(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSmall) OnMouseOut(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSmall) OnMouseOver(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSmall) OnMouseUp(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSmall) OnPaste(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSmall) OnReset(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSmall) OnScroll(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSmall) OnSearch(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("search", h, scope...) return e } func (e *htmlSmall) OnSelect(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("select", h, scope...) return e } func (e *htmlSmall) OnSubmit(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSmall) OnWheel(h EventHandler, scope ...any) HTMLSmall { e.setEventHandler("wheel", h, scope...) return e } // HTMLSource is the interface that describes a "source" HTML element. type HTMLSource interface { UI // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSource // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSource // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSource // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSource // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSource // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSource // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSource // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSource // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSource // ID specifies a unique id for an element. ID(v string) HTMLSource // Lang specifies the language of the element's content. Lang(v string) HTMLSource // Media specifies what media/device the linked document is optimized for. Media(v string) HTMLSource // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSource // Sizes specifies the size of the linked resource. Sizes(v string) HTMLSource // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSource // Src specifies the URL of the media file. Src(v string) HTMLSource // SrcSet specifies the URL of the image to use in different situations. SrcSet(v string) HTMLSource // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSource // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSource // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSource // Title specifies extra information about an element. Title(v string) HTMLSource // Type specifies the type of element. Type(v string) HTMLSource // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSource // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSource // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSource // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSource // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSource // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSource // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSource // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSource // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSource // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSource // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSource // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSource // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSource // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSource // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSource // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSource // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSource // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSource // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSource // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSource // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSource // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSource // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSource // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSource // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSource // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSource // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSource // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSource // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSource // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSource // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSource // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSource // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSource } // Source returns an HTML element that . func Source() HTMLSource { e := &htmlSource{ htmlElement: htmlElement{ tag: "source", isSelfClosing: true, }, } return e } type htmlSource struct { htmlElement } func (e *htmlSource) AccessKey(v string) HTMLSource { e.setAttr("accesskey", v) return e } func (e *htmlSource) Aria(k string, v any) HTMLSource { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSource) Attr(n string, v any) HTMLSource { e.setAttr(n, v) return e } func (e *htmlSource) Class(v ...string) HTMLSource { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSource) ContentEditable(v bool) HTMLSource { e.setAttr("contenteditable", v) return e } func (e *htmlSource) DataSet(k string, v any) HTMLSource { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSource) Dir(v string) HTMLSource { e.setAttr("dir", v) return e } func (e *htmlSource) Draggable(v bool) HTMLSource { e.setAttr("draggable", v) return e } func (e *htmlSource) Hidden(v bool) HTMLSource { e.setAttr("hidden", v) return e } func (e *htmlSource) ID(v string) HTMLSource { e.setAttr("id", v) return e } func (e *htmlSource) Lang(v string) HTMLSource { e.setAttr("lang", v) return e } func (e *htmlSource) Media(v string) HTMLSource { e.setAttr("media", v) return e } func (e *htmlSource) Role(v string) HTMLSource { e.setAttr("role", v) return e } func (e *htmlSource) Sizes(v string) HTMLSource { e.setAttr("sizes", v) return e } func (e *htmlSource) Spellcheck(v bool) HTMLSource { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSource) Src(v string) HTMLSource { e.setAttr("src", v) return e } func (e *htmlSource) SrcSet(v string) HTMLSource { e.setAttr("srcset", v) return e } func (e *htmlSource) Style(k, v string) HTMLSource { e.setAttr("style", k+":"+v) return e } func (e *htmlSource) Styles(s map[string]string) HTMLSource { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSource) TabIndex(v int) HTMLSource { e.setAttr("tabindex", v) return e } func (e *htmlSource) Title(v string) HTMLSource { e.setAttr("title", v) return e } func (e *htmlSource) Type(v string) HTMLSource { e.setAttr("type", v) return e } func (e *htmlSource) On(event string, h EventHandler, scope ...any) HTMLSource { e.setEventHandler(event, h, scope...) return e } func (e *htmlSource) OnBlur(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSource) OnChange(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("change", h, scope...) return e } func (e *htmlSource) OnClick(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("click", h, scope...) return e } func (e *htmlSource) OnContextMenu(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSource) OnCopy(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSource) OnCut(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSource) OnDblClick(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSource) OnDrag(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSource) OnDragEnd(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSource) OnDragEnter(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSource) OnDragLeave(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSource) OnDragOver(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSource) OnDragStart(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSource) OnDrop(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSource) OnFocus(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSource) OnInput(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("input", h, scope...) return e } func (e *htmlSource) OnInvalid(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSource) OnKeyDown(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSource) OnKeyPress(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSource) OnKeyUp(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSource) OnMouseDown(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSource) OnMouseMove(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSource) OnMouseOut(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSource) OnMouseOver(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSource) OnMouseUp(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSource) OnPaste(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSource) OnReset(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSource) OnScroll(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSource) OnSearch(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("search", h, scope...) return e } func (e *htmlSource) OnSelect(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("select", h, scope...) return e } func (e *htmlSource) OnSubmit(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSource) OnWheel(h EventHandler, scope ...any) HTMLSource { e.setEventHandler("wheel", h, scope...) return e } // HTMLSpan is the interface that describes a "span" HTML element. type HTMLSpan interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSpan // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSpan // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSpan // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSpan // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSpan // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSpan // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSpan // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSpan // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSpan // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSpan // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSpan // ID specifies a unique id for an element. ID(v string) HTMLSpan // Lang specifies the language of the element's content. Lang(v string) HTMLSpan // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSpan // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSpan // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSpan // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSpan // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSpan // Title specifies extra information about an element. Title(v string) HTMLSpan // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSpan // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSpan // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSpan // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSpan // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSpan // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSpan // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSpan // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSpan // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSpan // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSpan // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSpan // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSpan // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSpan // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSpan // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSpan // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSpan // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSpan // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSpan // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSpan // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSpan // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSpan // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSpan // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSpan // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSpan // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSpan // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSpan // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSpan // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSpan // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSpan // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSpan // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSpan // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSpan // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSpan } // Span returns an HTML element that defines a section in a document. func Span() HTMLSpan { e := &htmlSpan{ htmlElement: htmlElement{ tag: "span", isSelfClosing: false, }, } return e } type htmlSpan struct { htmlElement } func (e *htmlSpan) Body(v ...UI) HTMLSpan { e.setChildren(v...) return e } func (e *htmlSpan) Text(v any) HTMLSpan { return e.Body(Text(v)) } func (e *htmlSpan) AccessKey(v string) HTMLSpan { e.setAttr("accesskey", v) return e } func (e *htmlSpan) Aria(k string, v any) HTMLSpan { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSpan) Attr(n string, v any) HTMLSpan { e.setAttr(n, v) return e } func (e *htmlSpan) Class(v ...string) HTMLSpan { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSpan) ContentEditable(v bool) HTMLSpan { e.setAttr("contenteditable", v) return e } func (e *htmlSpan) DataSet(k string, v any) HTMLSpan { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSpan) Dir(v string) HTMLSpan { e.setAttr("dir", v) return e } func (e *htmlSpan) Draggable(v bool) HTMLSpan { e.setAttr("draggable", v) return e } func (e *htmlSpan) Hidden(v bool) HTMLSpan { e.setAttr("hidden", v) return e } func (e *htmlSpan) ID(v string) HTMLSpan { e.setAttr("id", v) return e } func (e *htmlSpan) Lang(v string) HTMLSpan { e.setAttr("lang", v) return e } func (e *htmlSpan) Role(v string) HTMLSpan { e.setAttr("role", v) return e } func (e *htmlSpan) Spellcheck(v bool) HTMLSpan { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSpan) Style(k, v string) HTMLSpan { e.setAttr("style", k+":"+v) return e } func (e *htmlSpan) Styles(s map[string]string) HTMLSpan { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSpan) TabIndex(v int) HTMLSpan { e.setAttr("tabindex", v) return e } func (e *htmlSpan) Title(v string) HTMLSpan { e.setAttr("title", v) return e } func (e *htmlSpan) On(event string, h EventHandler, scope ...any) HTMLSpan { e.setEventHandler(event, h, scope...) return e } func (e *htmlSpan) OnBlur(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSpan) OnChange(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("change", h, scope...) return e } func (e *htmlSpan) OnClick(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("click", h, scope...) return e } func (e *htmlSpan) OnContextMenu(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSpan) OnCopy(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSpan) OnCut(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSpan) OnDblClick(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSpan) OnDrag(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSpan) OnDragEnd(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSpan) OnDragEnter(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSpan) OnDragLeave(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSpan) OnDragOver(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSpan) OnDragStart(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSpan) OnDrop(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSpan) OnFocus(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSpan) OnInput(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("input", h, scope...) return e } func (e *htmlSpan) OnInvalid(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSpan) OnKeyDown(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSpan) OnKeyPress(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSpan) OnKeyUp(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSpan) OnMouseDown(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSpan) OnMouseMove(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSpan) OnMouseOut(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSpan) OnMouseOver(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSpan) OnMouseUp(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSpan) OnPaste(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSpan) OnReset(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSpan) OnScroll(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSpan) OnSearch(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("search", h, scope...) return e } func (e *htmlSpan) OnSelect(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("select", h, scope...) return e } func (e *htmlSpan) OnSubmit(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSpan) OnWheel(h EventHandler, scope ...any) HTMLSpan { e.setEventHandler("wheel", h, scope...) return e } // HTMLStrong is the interface that describes a "strong" HTML element. type HTMLStrong interface { UI // Body set the content of the element. Body(elems ...UI) HTMLStrong // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLStrong // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLStrong // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLStrong // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLStrong // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLStrong // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLStrong // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLStrong // Dir specifies the text direction for the content in an element. Dir(v string) HTMLStrong // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLStrong // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLStrong // ID specifies a unique id for an element. ID(v string) HTMLStrong // Lang specifies the language of the element's content. Lang(v string) HTMLStrong // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLStrong // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLStrong // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLStrong // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLStrong // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLStrong // Title specifies extra information about an element. Title(v string) HTMLStrong // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLStrong // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLStrong // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLStrong // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLStrong // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLStrong // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLStrong // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLStrong // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLStrong // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLStrong // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLStrong // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLStrong // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLStrong // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLStrong // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLStrong // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLStrong // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLStrong // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLStrong // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLStrong // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLStrong // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLStrong // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLStrong // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLStrong // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLStrong // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLStrong // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLStrong // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLStrong // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLStrong // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLStrong // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLStrong // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLStrong // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLStrong // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLStrong // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLStrong } // Strong returns an HTML element that defines important text. func Strong() HTMLStrong { e := &htmlStrong{ htmlElement: htmlElement{ tag: "strong", isSelfClosing: false, }, } return e } type htmlStrong struct { htmlElement } func (e *htmlStrong) Body(v ...UI) HTMLStrong { e.setChildren(v...) return e } func (e *htmlStrong) Text(v any) HTMLStrong { return e.Body(Text(v)) } func (e *htmlStrong) AccessKey(v string) HTMLStrong { e.setAttr("accesskey", v) return e } func (e *htmlStrong) Aria(k string, v any) HTMLStrong { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlStrong) Attr(n string, v any) HTMLStrong { e.setAttr(n, v) return e } func (e *htmlStrong) Class(v ...string) HTMLStrong { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlStrong) ContentEditable(v bool) HTMLStrong { e.setAttr("contenteditable", v) return e } func (e *htmlStrong) DataSet(k string, v any) HTMLStrong { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlStrong) Dir(v string) HTMLStrong { e.setAttr("dir", v) return e } func (e *htmlStrong) Draggable(v bool) HTMLStrong { e.setAttr("draggable", v) return e } func (e *htmlStrong) Hidden(v bool) HTMLStrong { e.setAttr("hidden", v) return e } func (e *htmlStrong) ID(v string) HTMLStrong { e.setAttr("id", v) return e } func (e *htmlStrong) Lang(v string) HTMLStrong { e.setAttr("lang", v) return e } func (e *htmlStrong) Role(v string) HTMLStrong { e.setAttr("role", v) return e } func (e *htmlStrong) Spellcheck(v bool) HTMLStrong { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlStrong) Style(k, v string) HTMLStrong { e.setAttr("style", k+":"+v) return e } func (e *htmlStrong) Styles(s map[string]string) HTMLStrong { for k, v := range s { e.Style(k, v) } return e } func (e *htmlStrong) TabIndex(v int) HTMLStrong { e.setAttr("tabindex", v) return e } func (e *htmlStrong) Title(v string) HTMLStrong { e.setAttr("title", v) return e } func (e *htmlStrong) On(event string, h EventHandler, scope ...any) HTMLStrong { e.setEventHandler(event, h, scope...) return e } func (e *htmlStrong) OnBlur(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("blur", h, scope...) return e } func (e *htmlStrong) OnChange(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("change", h, scope...) return e } func (e *htmlStrong) OnClick(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("click", h, scope...) return e } func (e *htmlStrong) OnContextMenu(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlStrong) OnCopy(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("copy", h, scope...) return e } func (e *htmlStrong) OnCut(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("cut", h, scope...) return e } func (e *htmlStrong) OnDblClick(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlStrong) OnDrag(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("drag", h, scope...) return e } func (e *htmlStrong) OnDragEnd(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlStrong) OnDragEnter(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlStrong) OnDragLeave(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlStrong) OnDragOver(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlStrong) OnDragStart(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlStrong) OnDrop(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("drop", h, scope...) return e } func (e *htmlStrong) OnFocus(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("focus", h, scope...) return e } func (e *htmlStrong) OnInput(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("input", h, scope...) return e } func (e *htmlStrong) OnInvalid(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlStrong) OnKeyDown(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlStrong) OnKeyPress(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlStrong) OnKeyUp(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlStrong) OnMouseDown(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlStrong) OnMouseMove(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlStrong) OnMouseOut(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlStrong) OnMouseOver(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlStrong) OnMouseUp(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlStrong) OnPaste(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("paste", h, scope...) return e } func (e *htmlStrong) OnReset(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("reset", h, scope...) return e } func (e *htmlStrong) OnScroll(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlStrong) OnSearch(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("search", h, scope...) return e } func (e *htmlStrong) OnSelect(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("select", h, scope...) return e } func (e *htmlStrong) OnSubmit(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("submit", h, scope...) return e } func (e *htmlStrong) OnWheel(h EventHandler, scope ...any) HTMLStrong { e.setEventHandler("wheel", h, scope...) return e } // HTMLStyle is the interface that describes a "style" HTML element. type HTMLStyle interface { UI // Body set the content of the element. Body(elems ...UI) HTMLStyle // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLStyle // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLStyle // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLStyle // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLStyle // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLStyle // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLStyle // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLStyle // Dir specifies the text direction for the content in an element. Dir(v string) HTMLStyle // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLStyle // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLStyle // ID specifies a unique id for an element. ID(v string) HTMLStyle // Lang specifies the language of the element's content. Lang(v string) HTMLStyle // Media specifies what media/device the linked document is optimized for. Media(v string) HTMLStyle // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLStyle // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLStyle // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLStyle // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLStyle // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLStyle // Title specifies extra information about an element. Title(v string) HTMLStyle // Type specifies the type of element. Type(v string) HTMLStyle // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLStyle // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLStyle // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLStyle // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLStyle // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLStyle // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLStyle // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLStyle // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLStyle // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLStyle // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLStyle // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLStyle // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLStyle // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLStyle // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLStyle // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLStyle // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLStyle // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLStyle // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLStyle // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLStyle // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLStyle // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLStyle // OnLoad calls the given handler after the element is finished loading. OnLoad(h EventHandler, scope ...any) HTMLStyle // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLStyle // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLStyle // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLStyle // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLStyle // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLStyle // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLStyle // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLStyle // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLStyle // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLStyle // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLStyle // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLStyle // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLStyle } // Style returns an HTML element that defines style information for a document. func Style() HTMLStyle { e := &htmlStyle{ htmlElement: htmlElement{ tag: "style", isSelfClosing: false, }, } return e } type htmlStyle struct { htmlElement } func (e *htmlStyle) Body(v ...UI) HTMLStyle { e.setChildren(v...) return e } func (e *htmlStyle) Text(v any) HTMLStyle { return e.Body(Text(v)) } func (e *htmlStyle) AccessKey(v string) HTMLStyle { e.setAttr("accesskey", v) return e } func (e *htmlStyle) Aria(k string, v any) HTMLStyle { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlStyle) Attr(n string, v any) HTMLStyle { e.setAttr(n, v) return e } func (e *htmlStyle) Class(v ...string) HTMLStyle { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlStyle) ContentEditable(v bool) HTMLStyle { e.setAttr("contenteditable", v) return e } func (e *htmlStyle) DataSet(k string, v any) HTMLStyle { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlStyle) Dir(v string) HTMLStyle { e.setAttr("dir", v) return e } func (e *htmlStyle) Draggable(v bool) HTMLStyle { e.setAttr("draggable", v) return e } func (e *htmlStyle) Hidden(v bool) HTMLStyle { e.setAttr("hidden", v) return e } func (e *htmlStyle) ID(v string) HTMLStyle { e.setAttr("id", v) return e } func (e *htmlStyle) Lang(v string) HTMLStyle { e.setAttr("lang", v) return e } func (e *htmlStyle) Media(v string) HTMLStyle { e.setAttr("media", v) return e } func (e *htmlStyle) Role(v string) HTMLStyle { e.setAttr("role", v) return e } func (e *htmlStyle) Spellcheck(v bool) HTMLStyle { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlStyle) Style(k, v string) HTMLStyle { e.setAttr("style", k+":"+v) return e } func (e *htmlStyle) Styles(s map[string]string) HTMLStyle { for k, v := range s { e.Style(k, v) } return e } func (e *htmlStyle) TabIndex(v int) HTMLStyle { e.setAttr("tabindex", v) return e } func (e *htmlStyle) Title(v string) HTMLStyle { e.setAttr("title", v) return e } func (e *htmlStyle) Type(v string) HTMLStyle { e.setAttr("type", v) return e } func (e *htmlStyle) On(event string, h EventHandler, scope ...any) HTMLStyle { e.setEventHandler(event, h, scope...) return e } func (e *htmlStyle) OnBlur(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("blur", h, scope...) return e } func (e *htmlStyle) OnChange(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("change", h, scope...) return e } func (e *htmlStyle) OnClick(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("click", h, scope...) return e } func (e *htmlStyle) OnContextMenu(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlStyle) OnCopy(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("copy", h, scope...) return e } func (e *htmlStyle) OnCut(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("cut", h, scope...) return e } func (e *htmlStyle) OnDblClick(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlStyle) OnDrag(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("drag", h, scope...) return e } func (e *htmlStyle) OnDragEnd(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlStyle) OnDragEnter(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlStyle) OnDragLeave(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlStyle) OnDragOver(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlStyle) OnDragStart(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlStyle) OnDrop(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("drop", h, scope...) return e } func (e *htmlStyle) OnFocus(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("focus", h, scope...) return e } func (e *htmlStyle) OnInput(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("input", h, scope...) return e } func (e *htmlStyle) OnInvalid(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlStyle) OnKeyDown(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlStyle) OnKeyPress(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlStyle) OnKeyUp(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlStyle) OnLoad(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("load", h, scope...) return e } func (e *htmlStyle) OnMouseDown(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlStyle) OnMouseMove(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlStyle) OnMouseOut(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlStyle) OnMouseOver(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlStyle) OnMouseUp(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlStyle) OnPaste(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("paste", h, scope...) return e } func (e *htmlStyle) OnReset(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("reset", h, scope...) return e } func (e *htmlStyle) OnScroll(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlStyle) OnSearch(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("search", h, scope...) return e } func (e *htmlStyle) OnSelect(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("select", h, scope...) return e } func (e *htmlStyle) OnSubmit(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("submit", h, scope...) return e } func (e *htmlStyle) OnWheel(h EventHandler, scope ...any) HTMLStyle { e.setEventHandler("wheel", h, scope...) return e } // HTMLSub is the interface that describes a "sub" HTML element. type HTMLSub interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSub // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSub // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSub // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSub // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSub // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSub // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSub // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSub // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSub // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSub // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSub // ID specifies a unique id for an element. ID(v string) HTMLSub // Lang specifies the language of the element's content. Lang(v string) HTMLSub // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSub // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSub // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSub // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSub // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSub // Title specifies extra information about an element. Title(v string) HTMLSub // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSub // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSub // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSub // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSub // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSub // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSub // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSub // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSub // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSub // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSub // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSub // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSub // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSub // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSub // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSub // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSub // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSub // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSub // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSub // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSub // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSub // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSub // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSub // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSub // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSub // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSub // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSub // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSub // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSub // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSub // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSub // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSub // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSub } // Sub returns an HTML element that defines subscripted text. func Sub() HTMLSub { e := &htmlSub{ htmlElement: htmlElement{ tag: "sub", isSelfClosing: false, }, } return e } type htmlSub struct { htmlElement } func (e *htmlSub) Body(v ...UI) HTMLSub { e.setChildren(v...) return e } func (e *htmlSub) Text(v any) HTMLSub { return e.Body(Text(v)) } func (e *htmlSub) AccessKey(v string) HTMLSub { e.setAttr("accesskey", v) return e } func (e *htmlSub) Aria(k string, v any) HTMLSub { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSub) Attr(n string, v any) HTMLSub { e.setAttr(n, v) return e } func (e *htmlSub) Class(v ...string) HTMLSub { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSub) ContentEditable(v bool) HTMLSub { e.setAttr("contenteditable", v) return e } func (e *htmlSub) DataSet(k string, v any) HTMLSub { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSub) Dir(v string) HTMLSub { e.setAttr("dir", v) return e } func (e *htmlSub) Draggable(v bool) HTMLSub { e.setAttr("draggable", v) return e } func (e *htmlSub) Hidden(v bool) HTMLSub { e.setAttr("hidden", v) return e } func (e *htmlSub) ID(v string) HTMLSub { e.setAttr("id", v) return e } func (e *htmlSub) Lang(v string) HTMLSub { e.setAttr("lang", v) return e } func (e *htmlSub) Role(v string) HTMLSub { e.setAttr("role", v) return e } func (e *htmlSub) Spellcheck(v bool) HTMLSub { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSub) Style(k, v string) HTMLSub { e.setAttr("style", k+":"+v) return e } func (e *htmlSub) Styles(s map[string]string) HTMLSub { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSub) TabIndex(v int) HTMLSub { e.setAttr("tabindex", v) return e } func (e *htmlSub) Title(v string) HTMLSub { e.setAttr("title", v) return e } func (e *htmlSub) On(event string, h EventHandler, scope ...any) HTMLSub { e.setEventHandler(event, h, scope...) return e } func (e *htmlSub) OnBlur(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSub) OnChange(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("change", h, scope...) return e } func (e *htmlSub) OnClick(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("click", h, scope...) return e } func (e *htmlSub) OnContextMenu(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSub) OnCopy(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSub) OnCut(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSub) OnDblClick(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSub) OnDrag(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSub) OnDragEnd(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSub) OnDragEnter(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSub) OnDragLeave(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSub) OnDragOver(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSub) OnDragStart(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSub) OnDrop(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSub) OnFocus(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSub) OnInput(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("input", h, scope...) return e } func (e *htmlSub) OnInvalid(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSub) OnKeyDown(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSub) OnKeyPress(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSub) OnKeyUp(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSub) OnMouseDown(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSub) OnMouseMove(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSub) OnMouseOut(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSub) OnMouseOver(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSub) OnMouseUp(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSub) OnPaste(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSub) OnReset(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSub) OnScroll(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSub) OnSearch(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("search", h, scope...) return e } func (e *htmlSub) OnSelect(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("select", h, scope...) return e } func (e *htmlSub) OnSubmit(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSub) OnWheel(h EventHandler, scope ...any) HTMLSub { e.setEventHandler("wheel", h, scope...) return e } // HTMLSummary is the interface that describes a "summary" HTML element. type HTMLSummary interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSummary // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSummary // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSummary // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSummary // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSummary // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSummary // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSummary // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSummary // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSummary // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSummary // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSummary // ID specifies a unique id for an element. ID(v string) HTMLSummary // Lang specifies the language of the element's content. Lang(v string) HTMLSummary // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSummary // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSummary // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSummary // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSummary // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSummary // Title specifies extra information about an element. Title(v string) HTMLSummary // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSummary // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSummary // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSummary // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSummary // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSummary // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSummary // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSummary // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSummary // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSummary // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSummary // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSummary // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSummary // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSummary // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSummary // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSummary // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSummary // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSummary // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSummary // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSummary // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSummary // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSummary // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSummary // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSummary // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSummary // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSummary // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSummary // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSummary // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSummary // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSummary // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSummary // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSummary // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSummary // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSummary } // Summary returns an HTML element that defines a visible heading for a details element. func Summary() HTMLSummary { e := &htmlSummary{ htmlElement: htmlElement{ tag: "summary", isSelfClosing: false, }, } return e } type htmlSummary struct { htmlElement } func (e *htmlSummary) Body(v ...UI) HTMLSummary { e.setChildren(v...) return e } func (e *htmlSummary) Text(v any) HTMLSummary { return e.Body(Text(v)) } func (e *htmlSummary) AccessKey(v string) HTMLSummary { e.setAttr("accesskey", v) return e } func (e *htmlSummary) Aria(k string, v any) HTMLSummary { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSummary) Attr(n string, v any) HTMLSummary { e.setAttr(n, v) return e } func (e *htmlSummary) Class(v ...string) HTMLSummary { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSummary) ContentEditable(v bool) HTMLSummary { e.setAttr("contenteditable", v) return e } func (e *htmlSummary) DataSet(k string, v any) HTMLSummary { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSummary) Dir(v string) HTMLSummary { e.setAttr("dir", v) return e } func (e *htmlSummary) Draggable(v bool) HTMLSummary { e.setAttr("draggable", v) return e } func (e *htmlSummary) Hidden(v bool) HTMLSummary { e.setAttr("hidden", v) return e } func (e *htmlSummary) ID(v string) HTMLSummary { e.setAttr("id", v) return e } func (e *htmlSummary) Lang(v string) HTMLSummary { e.setAttr("lang", v) return e } func (e *htmlSummary) Role(v string) HTMLSummary { e.setAttr("role", v) return e } func (e *htmlSummary) Spellcheck(v bool) HTMLSummary { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSummary) Style(k, v string) HTMLSummary { e.setAttr("style", k+":"+v) return e } func (e *htmlSummary) Styles(s map[string]string) HTMLSummary { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSummary) TabIndex(v int) HTMLSummary { e.setAttr("tabindex", v) return e } func (e *htmlSummary) Title(v string) HTMLSummary { e.setAttr("title", v) return e } func (e *htmlSummary) On(event string, h EventHandler, scope ...any) HTMLSummary { e.setEventHandler(event, h, scope...) return e } func (e *htmlSummary) OnBlur(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSummary) OnChange(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("change", h, scope...) return e } func (e *htmlSummary) OnClick(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("click", h, scope...) return e } func (e *htmlSummary) OnContextMenu(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSummary) OnCopy(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSummary) OnCut(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSummary) OnDblClick(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSummary) OnDrag(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSummary) OnDragEnd(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSummary) OnDragEnter(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSummary) OnDragLeave(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSummary) OnDragOver(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSummary) OnDragStart(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSummary) OnDrop(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSummary) OnFocus(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSummary) OnInput(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("input", h, scope...) return e } func (e *htmlSummary) OnInvalid(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSummary) OnKeyDown(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSummary) OnKeyPress(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSummary) OnKeyUp(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSummary) OnMouseDown(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSummary) OnMouseMove(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSummary) OnMouseOut(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSummary) OnMouseOver(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSummary) OnMouseUp(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSummary) OnPaste(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSummary) OnReset(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSummary) OnScroll(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSummary) OnSearch(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("search", h, scope...) return e } func (e *htmlSummary) OnSelect(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("select", h, scope...) return e } func (e *htmlSummary) OnSubmit(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSummary) OnWheel(h EventHandler, scope ...any) HTMLSummary { e.setEventHandler("wheel", h, scope...) return e } // HTMLSup is the interface that describes a "sup" HTML element. type HTMLSup interface { UI // Body set the content of the element. Body(elems ...UI) HTMLSup // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLSup // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLSup // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLSup // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLSup // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLSup // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLSup // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLSup // Dir specifies the text direction for the content in an element. Dir(v string) HTMLSup // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLSup // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLSup // ID specifies a unique id for an element. ID(v string) HTMLSup // Lang specifies the language of the element's content. Lang(v string) HTMLSup // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLSup // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLSup // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLSup // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLSup // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLSup // Title specifies extra information about an element. Title(v string) HTMLSup // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLSup // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLSup // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLSup // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLSup // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLSup // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLSup // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLSup // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLSup // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLSup // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLSup // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLSup // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLSup // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLSup // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLSup // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLSup // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLSup // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLSup // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLSup // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLSup // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLSup // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLSup // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLSup // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLSup // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLSup // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLSup // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLSup // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLSup // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLSup // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLSup // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLSup // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLSup // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLSup // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLSup } // Sup returns an HTML element that defines superscripted text. func Sup() HTMLSup { e := &htmlSup{ htmlElement: htmlElement{ tag: "sup", isSelfClosing: false, }, } return e } type htmlSup struct { htmlElement } func (e *htmlSup) Body(v ...UI) HTMLSup { e.setChildren(v...) return e } func (e *htmlSup) Text(v any) HTMLSup { return e.Body(Text(v)) } func (e *htmlSup) AccessKey(v string) HTMLSup { e.setAttr("accesskey", v) return e } func (e *htmlSup) Aria(k string, v any) HTMLSup { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSup) Attr(n string, v any) HTMLSup { e.setAttr(n, v) return e } func (e *htmlSup) Class(v ...string) HTMLSup { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlSup) ContentEditable(v bool) HTMLSup { e.setAttr("contenteditable", v) return e } func (e *htmlSup) DataSet(k string, v any) HTMLSup { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlSup) Dir(v string) HTMLSup { e.setAttr("dir", v) return e } func (e *htmlSup) Draggable(v bool) HTMLSup { e.setAttr("draggable", v) return e } func (e *htmlSup) Hidden(v bool) HTMLSup { e.setAttr("hidden", v) return e } func (e *htmlSup) ID(v string) HTMLSup { e.setAttr("id", v) return e } func (e *htmlSup) Lang(v string) HTMLSup { e.setAttr("lang", v) return e } func (e *htmlSup) Role(v string) HTMLSup { e.setAttr("role", v) return e } func (e *htmlSup) Spellcheck(v bool) HTMLSup { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlSup) Style(k, v string) HTMLSup { e.setAttr("style", k+":"+v) return e } func (e *htmlSup) Styles(s map[string]string) HTMLSup { for k, v := range s { e.Style(k, v) } return e } func (e *htmlSup) TabIndex(v int) HTMLSup { e.setAttr("tabindex", v) return e } func (e *htmlSup) Title(v string) HTMLSup { e.setAttr("title", v) return e } func (e *htmlSup) On(event string, h EventHandler, scope ...any) HTMLSup { e.setEventHandler(event, h, scope...) return e } func (e *htmlSup) OnBlur(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("blur", h, scope...) return e } func (e *htmlSup) OnChange(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("change", h, scope...) return e } func (e *htmlSup) OnClick(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("click", h, scope...) return e } func (e *htmlSup) OnContextMenu(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlSup) OnCopy(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("copy", h, scope...) return e } func (e *htmlSup) OnCut(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("cut", h, scope...) return e } func (e *htmlSup) OnDblClick(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlSup) OnDrag(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("drag", h, scope...) return e } func (e *htmlSup) OnDragEnd(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlSup) OnDragEnter(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlSup) OnDragLeave(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlSup) OnDragOver(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlSup) OnDragStart(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlSup) OnDrop(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("drop", h, scope...) return e } func (e *htmlSup) OnFocus(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("focus", h, scope...) return e } func (e *htmlSup) OnInput(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("input", h, scope...) return e } func (e *htmlSup) OnInvalid(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlSup) OnKeyDown(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlSup) OnKeyPress(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlSup) OnKeyUp(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlSup) OnMouseDown(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlSup) OnMouseMove(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlSup) OnMouseOut(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlSup) OnMouseOver(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlSup) OnMouseUp(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlSup) OnPaste(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("paste", h, scope...) return e } func (e *htmlSup) OnReset(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("reset", h, scope...) return e } func (e *htmlSup) OnScroll(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlSup) OnSearch(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("search", h, scope...) return e } func (e *htmlSup) OnSelect(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("select", h, scope...) return e } func (e *htmlSup) OnSubmit(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("submit", h, scope...) return e } func (e *htmlSup) OnWheel(h EventHandler, scope ...any) HTMLSup { e.setEventHandler("wheel", h, scope...) return e } // HTMLTable is the interface that describes a "table" HTML element. type HTMLTable interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTable // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTable // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTable // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTable // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTable // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTable // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTable // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTable // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTable // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTable // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTable // ID specifies a unique id for an element. ID(v string) HTMLTable // Lang specifies the language of the element's content. Lang(v string) HTMLTable // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTable // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTable // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTable // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTable // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTable // Title specifies extra information about an element. Title(v string) HTMLTable // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTable // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTable // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTable // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTable // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTable // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTable // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTable // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTable // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTable // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTable // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTable // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTable // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTable // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTable // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTable // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTable // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTable // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTable // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTable // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTable // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTable // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTable // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTable // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTable // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTable // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTable // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTable // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTable // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTable // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTable // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTable // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTable // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTable } // Table returns an HTML element that defines a table. func Table() HTMLTable { e := &htmlTable{ htmlElement: htmlElement{ tag: "table", isSelfClosing: false, }, } return e } type htmlTable struct { htmlElement } func (e *htmlTable) Body(v ...UI) HTMLTable { e.setChildren(v...) return e } func (e *htmlTable) Text(v any) HTMLTable { return e.Body(Text(v)) } func (e *htmlTable) AccessKey(v string) HTMLTable { e.setAttr("accesskey", v) return e } func (e *htmlTable) Aria(k string, v any) HTMLTable { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTable) Attr(n string, v any) HTMLTable { e.setAttr(n, v) return e } func (e *htmlTable) Class(v ...string) HTMLTable { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTable) ContentEditable(v bool) HTMLTable { e.setAttr("contenteditable", v) return e } func (e *htmlTable) DataSet(k string, v any) HTMLTable { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTable) Dir(v string) HTMLTable { e.setAttr("dir", v) return e } func (e *htmlTable) Draggable(v bool) HTMLTable { e.setAttr("draggable", v) return e } func (e *htmlTable) Hidden(v bool) HTMLTable { e.setAttr("hidden", v) return e } func (e *htmlTable) ID(v string) HTMLTable { e.setAttr("id", v) return e } func (e *htmlTable) Lang(v string) HTMLTable { e.setAttr("lang", v) return e } func (e *htmlTable) Role(v string) HTMLTable { e.setAttr("role", v) return e } func (e *htmlTable) Spellcheck(v bool) HTMLTable { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTable) Style(k, v string) HTMLTable { e.setAttr("style", k+":"+v) return e } func (e *htmlTable) Styles(s map[string]string) HTMLTable { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTable) TabIndex(v int) HTMLTable { e.setAttr("tabindex", v) return e } func (e *htmlTable) Title(v string) HTMLTable { e.setAttr("title", v) return e } func (e *htmlTable) On(event string, h EventHandler, scope ...any) HTMLTable { e.setEventHandler(event, h, scope...) return e } func (e *htmlTable) OnBlur(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTable) OnChange(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("change", h, scope...) return e } func (e *htmlTable) OnClick(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("click", h, scope...) return e } func (e *htmlTable) OnContextMenu(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTable) OnCopy(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTable) OnCut(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTable) OnDblClick(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTable) OnDrag(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTable) OnDragEnd(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTable) OnDragEnter(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTable) OnDragLeave(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTable) OnDragOver(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTable) OnDragStart(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTable) OnDrop(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTable) OnFocus(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTable) OnInput(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("input", h, scope...) return e } func (e *htmlTable) OnInvalid(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTable) OnKeyDown(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTable) OnKeyPress(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTable) OnKeyUp(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTable) OnMouseDown(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTable) OnMouseMove(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTable) OnMouseOut(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTable) OnMouseOver(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTable) OnMouseUp(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTable) OnPaste(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTable) OnReset(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTable) OnScroll(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTable) OnSearch(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("search", h, scope...) return e } func (e *htmlTable) OnSelect(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("select", h, scope...) return e } func (e *htmlTable) OnSubmit(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTable) OnWheel(h EventHandler, scope ...any) HTMLTable { e.setEventHandler("wheel", h, scope...) return e } // HTMLTBody is the interface that describes a "tbody" HTML element. type HTMLTBody interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTBody // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTBody // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTBody // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTBody // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTBody // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTBody // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTBody // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTBody // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTBody // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTBody // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTBody // ID specifies a unique id for an element. ID(v string) HTMLTBody // Lang specifies the language of the element's content. Lang(v string) HTMLTBody // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTBody // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTBody // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTBody // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTBody // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTBody // Title specifies extra information about an element. Title(v string) HTMLTBody // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTBody // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTBody // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTBody // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTBody // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTBody // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTBody // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTBody // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTBody // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTBody // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTBody // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTBody // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTBody // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTBody // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTBody // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTBody // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTBody // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTBody // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTBody // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTBody // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTBody // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTBody // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTBody // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTBody // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTBody // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTBody // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTBody // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTBody // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTBody // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTBody // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTBody // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTBody // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTBody // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTBody } // TBody returns an HTML element that groups the body content in a table. func TBody() HTMLTBody { e := &htmlTBody{ htmlElement: htmlElement{ tag: "tbody", isSelfClosing: false, }, } return e } type htmlTBody struct { htmlElement } func (e *htmlTBody) Body(v ...UI) HTMLTBody { e.setChildren(v...) return e } func (e *htmlTBody) Text(v any) HTMLTBody { return e.Body(Text(v)) } func (e *htmlTBody) AccessKey(v string) HTMLTBody { e.setAttr("accesskey", v) return e } func (e *htmlTBody) Aria(k string, v any) HTMLTBody { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTBody) Attr(n string, v any) HTMLTBody { e.setAttr(n, v) return e } func (e *htmlTBody) Class(v ...string) HTMLTBody { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTBody) ContentEditable(v bool) HTMLTBody { e.setAttr("contenteditable", v) return e } func (e *htmlTBody) DataSet(k string, v any) HTMLTBody { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTBody) Dir(v string) HTMLTBody { e.setAttr("dir", v) return e } func (e *htmlTBody) Draggable(v bool) HTMLTBody { e.setAttr("draggable", v) return e } func (e *htmlTBody) Hidden(v bool) HTMLTBody { e.setAttr("hidden", v) return e } func (e *htmlTBody) ID(v string) HTMLTBody { e.setAttr("id", v) return e } func (e *htmlTBody) Lang(v string) HTMLTBody { e.setAttr("lang", v) return e } func (e *htmlTBody) Role(v string) HTMLTBody { e.setAttr("role", v) return e } func (e *htmlTBody) Spellcheck(v bool) HTMLTBody { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTBody) Style(k, v string) HTMLTBody { e.setAttr("style", k+":"+v) return e } func (e *htmlTBody) Styles(s map[string]string) HTMLTBody { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTBody) TabIndex(v int) HTMLTBody { e.setAttr("tabindex", v) return e } func (e *htmlTBody) Title(v string) HTMLTBody { e.setAttr("title", v) return e } func (e *htmlTBody) On(event string, h EventHandler, scope ...any) HTMLTBody { e.setEventHandler(event, h, scope...) return e } func (e *htmlTBody) OnBlur(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTBody) OnChange(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("change", h, scope...) return e } func (e *htmlTBody) OnClick(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("click", h, scope...) return e } func (e *htmlTBody) OnContextMenu(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTBody) OnCopy(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTBody) OnCut(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTBody) OnDblClick(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTBody) OnDrag(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTBody) OnDragEnd(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTBody) OnDragEnter(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTBody) OnDragLeave(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTBody) OnDragOver(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTBody) OnDragStart(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTBody) OnDrop(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTBody) OnFocus(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTBody) OnInput(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("input", h, scope...) return e } func (e *htmlTBody) OnInvalid(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTBody) OnKeyDown(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTBody) OnKeyPress(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTBody) OnKeyUp(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTBody) OnMouseDown(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTBody) OnMouseMove(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTBody) OnMouseOut(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTBody) OnMouseOver(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTBody) OnMouseUp(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTBody) OnPaste(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTBody) OnReset(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTBody) OnScroll(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTBody) OnSearch(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("search", h, scope...) return e } func (e *htmlTBody) OnSelect(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("select", h, scope...) return e } func (e *htmlTBody) OnSubmit(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTBody) OnWheel(h EventHandler, scope ...any) HTMLTBody { e.setEventHandler("wheel", h, scope...) return e } // HTMLTd is the interface that describes a "td" HTML element. type HTMLTd interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTd // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTd // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTd // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTd // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTd // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTd // ColSpan specifies the number of columns a table cell should span. ColSpan(v int) HTMLTd // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTd // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTd // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTd // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTd // Headers specifies one or more headers cells a cell is related to. Headers(v string) HTMLTd // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTd // ID specifies a unique id for an element. ID(v string) HTMLTd // Lang specifies the language of the element's content. Lang(v string) HTMLTd // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTd // Rowspan specifies the number of rows a table cell should span. Rowspan(v int) HTMLTd // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTd // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTd // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTd // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTd // Title specifies extra information about an element. Title(v string) HTMLTd // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTd // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTd // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTd // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTd // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTd // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTd // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTd // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTd // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTd // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTd // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTd // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTd // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTd // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTd // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTd // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTd // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTd // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTd // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTd // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTd // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTd // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTd // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTd // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTd // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTd // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTd // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTd // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTd // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTd // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTd // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTd // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTd // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTd } // Td returns an HTML element that defines a cell in a table. func Td() HTMLTd { e := &htmlTd{ htmlElement: htmlElement{ tag: "td", isSelfClosing: false, }, } return e } type htmlTd struct { htmlElement } func (e *htmlTd) Body(v ...UI) HTMLTd { e.setChildren(v...) return e } func (e *htmlTd) Text(v any) HTMLTd { return e.Body(Text(v)) } func (e *htmlTd) AccessKey(v string) HTMLTd { e.setAttr("accesskey", v) return e } func (e *htmlTd) Aria(k string, v any) HTMLTd { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTd) Attr(n string, v any) HTMLTd { e.setAttr(n, v) return e } func (e *htmlTd) Class(v ...string) HTMLTd { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTd) ColSpan(v int) HTMLTd { e.setAttr("colspan", v) return e } func (e *htmlTd) ContentEditable(v bool) HTMLTd { e.setAttr("contenteditable", v) return e } func (e *htmlTd) DataSet(k string, v any) HTMLTd { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTd) Dir(v string) HTMLTd { e.setAttr("dir", v) return e } func (e *htmlTd) Draggable(v bool) HTMLTd { e.setAttr("draggable", v) return e } func (e *htmlTd) Headers(v string) HTMLTd { e.setAttr("headers", v) return e } func (e *htmlTd) Hidden(v bool) HTMLTd { e.setAttr("hidden", v) return e } func (e *htmlTd) ID(v string) HTMLTd { e.setAttr("id", v) return e } func (e *htmlTd) Lang(v string) HTMLTd { e.setAttr("lang", v) return e } func (e *htmlTd) Role(v string) HTMLTd { e.setAttr("role", v) return e } func (e *htmlTd) Rowspan(v int) HTMLTd { e.setAttr("rowspan", v) return e } func (e *htmlTd) Spellcheck(v bool) HTMLTd { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTd) Style(k, v string) HTMLTd { e.setAttr("style", k+":"+v) return e } func (e *htmlTd) Styles(s map[string]string) HTMLTd { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTd) TabIndex(v int) HTMLTd { e.setAttr("tabindex", v) return e } func (e *htmlTd) Title(v string) HTMLTd { e.setAttr("title", v) return e } func (e *htmlTd) On(event string, h EventHandler, scope ...any) HTMLTd { e.setEventHandler(event, h, scope...) return e } func (e *htmlTd) OnBlur(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTd) OnChange(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("change", h, scope...) return e } func (e *htmlTd) OnClick(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("click", h, scope...) return e } func (e *htmlTd) OnContextMenu(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTd) OnCopy(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTd) OnCut(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTd) OnDblClick(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTd) OnDrag(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTd) OnDragEnd(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTd) OnDragEnter(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTd) OnDragLeave(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTd) OnDragOver(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTd) OnDragStart(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTd) OnDrop(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTd) OnFocus(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTd) OnInput(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("input", h, scope...) return e } func (e *htmlTd) OnInvalid(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTd) OnKeyDown(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTd) OnKeyPress(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTd) OnKeyUp(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTd) OnMouseDown(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTd) OnMouseMove(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTd) OnMouseOut(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTd) OnMouseOver(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTd) OnMouseUp(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTd) OnPaste(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTd) OnReset(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTd) OnScroll(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTd) OnSearch(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("search", h, scope...) return e } func (e *htmlTd) OnSelect(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("select", h, scope...) return e } func (e *htmlTd) OnSubmit(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTd) OnWheel(h EventHandler, scope ...any) HTMLTd { e.setEventHandler("wheel", h, scope...) return e } // HTMLTemplate is the interface that describes a "template" HTML element. type HTMLTemplate interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTemplate // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTemplate // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTemplate // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTemplate // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTemplate // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTemplate // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTemplate // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTemplate // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTemplate // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTemplate // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTemplate // ID specifies a unique id for an element. ID(v string) HTMLTemplate // Lang specifies the language of the element's content. Lang(v string) HTMLTemplate // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTemplate // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTemplate // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTemplate // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTemplate // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTemplate // Title specifies extra information about an element. Title(v string) HTMLTemplate // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTemplate } // Template returns an HTML element that defines a template. func Template() HTMLTemplate { e := &htmlTemplate{ htmlElement: htmlElement{ tag: "template", isSelfClosing: false, }, } return e } type htmlTemplate struct { htmlElement } func (e *htmlTemplate) Body(v ...UI) HTMLTemplate { e.setChildren(v...) return e } func (e *htmlTemplate) Text(v any) HTMLTemplate { return e.Body(Text(v)) } func (e *htmlTemplate) AccessKey(v string) HTMLTemplate { e.setAttr("accesskey", v) return e } func (e *htmlTemplate) Aria(k string, v any) HTMLTemplate { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTemplate) Attr(n string, v any) HTMLTemplate { e.setAttr(n, v) return e } func (e *htmlTemplate) Class(v ...string) HTMLTemplate { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTemplate) ContentEditable(v bool) HTMLTemplate { e.setAttr("contenteditable", v) return e } func (e *htmlTemplate) DataSet(k string, v any) HTMLTemplate { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTemplate) Dir(v string) HTMLTemplate { e.setAttr("dir", v) return e } func (e *htmlTemplate) Draggable(v bool) HTMLTemplate { e.setAttr("draggable", v) return e } func (e *htmlTemplate) Hidden(v bool) HTMLTemplate { e.setAttr("hidden", v) return e } func (e *htmlTemplate) ID(v string) HTMLTemplate { e.setAttr("id", v) return e } func (e *htmlTemplate) Lang(v string) HTMLTemplate { e.setAttr("lang", v) return e } func (e *htmlTemplate) Role(v string) HTMLTemplate { e.setAttr("role", v) return e } func (e *htmlTemplate) Spellcheck(v bool) HTMLTemplate { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTemplate) Style(k, v string) HTMLTemplate { e.setAttr("style", k+":"+v) return e } func (e *htmlTemplate) Styles(s map[string]string) HTMLTemplate { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTemplate) TabIndex(v int) HTMLTemplate { e.setAttr("tabindex", v) return e } func (e *htmlTemplate) Title(v string) HTMLTemplate { e.setAttr("title", v) return e } func (e *htmlTemplate) On(event string, h EventHandler, scope ...any) HTMLTemplate { e.setEventHandler(event, h, scope...) return e } // HTMLTextarea is the interface that describes a "textarea" HTML element. type HTMLTextarea interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTextarea // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTextarea // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTextarea // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTextarea // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTextarea // AutoFocus specifies that the element should automatically get focus when the page loads. AutoFocus(v bool) HTMLTextarea // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTextarea // Cols specifies the visible width of a text area. Cols(v int) HTMLTextarea // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTextarea // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTextarea // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTextarea // DirName specifies that the text direction will be submitted. DirName(v string) HTMLTextarea // Disabled specifies that the specified element/group of elements should be disabled. Disabled(v bool) HTMLTextarea // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTextarea // Form specifies the name of the form the element belongs to. Form(v string) HTMLTextarea // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTextarea // ID specifies a unique id for an element. ID(v string) HTMLTextarea // Lang specifies the language of the element's content. Lang(v string) HTMLTextarea // MaxLength specifies the maximum number of characters allowed in an element. MaxLength(v int) HTMLTextarea // Name specifies the name of the element. Name(v string) HTMLTextarea // Placeholder specifies a short hint that describes the expected value of the element. Placeholder(v string) HTMLTextarea // ReadOnly specifies that the element is read-only. ReadOnly(v bool) HTMLTextarea // Required specifies that the element must be filled out before submitting the form. Required(v bool) HTMLTextarea // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTextarea // Rows specifies the visible number of lines in a text area. Rows(v int) HTMLTextarea // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTextarea // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTextarea // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTextarea // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTextarea // Title specifies extra information about an element. Title(v string) HTMLTextarea // Wrap specifies how the text in a text area is to be wrapped when submitted in a form. Wrap(v string) HTMLTextarea // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTextarea // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTextarea // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTextarea // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTextarea // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTextarea // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTextarea // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTextarea // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTextarea // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTextarea // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTextarea // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTextarea // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTextarea // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTextarea // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTextarea // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTextarea // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTextarea // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTextarea // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTextarea // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTextarea // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTextarea // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTextarea // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTextarea // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTextarea // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTextarea // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTextarea // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTextarea // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTextarea // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTextarea // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTextarea // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTextarea // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTextarea // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTextarea // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTextarea } // Textarea returns an HTML element that defines a multiline input control (text area). func Textarea() HTMLTextarea { e := &htmlTextarea{ htmlElement: htmlElement{ tag: "textarea", isSelfClosing: false, }, } return e } type htmlTextarea struct { htmlElement } func (e *htmlTextarea) Body(v ...UI) HTMLTextarea { e.setChildren(v...) return e } func (e *htmlTextarea) Text(v any) HTMLTextarea { e.setAttr("value", v) return e } func (e *htmlTextarea) AccessKey(v string) HTMLTextarea { e.setAttr("accesskey", v) return e } func (e *htmlTextarea) Aria(k string, v any) HTMLTextarea { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTextarea) Attr(n string, v any) HTMLTextarea { e.setAttr(n, v) return e } func (e *htmlTextarea) AutoFocus(v bool) HTMLTextarea { e.setAttr("autofocus", v) return e } func (e *htmlTextarea) Class(v ...string) HTMLTextarea { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTextarea) Cols(v int) HTMLTextarea { e.setAttr("cols", v) return e } func (e *htmlTextarea) ContentEditable(v bool) HTMLTextarea { e.setAttr("contenteditable", v) return e } func (e *htmlTextarea) DataSet(k string, v any) HTMLTextarea { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTextarea) Dir(v string) HTMLTextarea { e.setAttr("dir", v) return e } func (e *htmlTextarea) DirName(v string) HTMLTextarea { e.setAttr("dirname", v) return e } func (e *htmlTextarea) Disabled(v bool) HTMLTextarea { e.setAttr("disabled", v) return e } func (e *htmlTextarea) Draggable(v bool) HTMLTextarea { e.setAttr("draggable", v) return e } func (e *htmlTextarea) Form(v string) HTMLTextarea { e.setAttr("form", v) return e } func (e *htmlTextarea) Hidden(v bool) HTMLTextarea { e.setAttr("hidden", v) return e } func (e *htmlTextarea) ID(v string) HTMLTextarea { e.setAttr("id", v) return e } func (e *htmlTextarea) Lang(v string) HTMLTextarea { e.setAttr("lang", v) return e } func (e *htmlTextarea) MaxLength(v int) HTMLTextarea { e.setAttr("maxlength", v) return e } func (e *htmlTextarea) Name(v string) HTMLTextarea { e.setAttr("name", v) return e } func (e *htmlTextarea) Placeholder(v string) HTMLTextarea { e.setAttr("placeholder", v) return e } func (e *htmlTextarea) ReadOnly(v bool) HTMLTextarea { e.setAttr("readonly", v) return e } func (e *htmlTextarea) Required(v bool) HTMLTextarea { e.setAttr("required", v) return e } func (e *htmlTextarea) Role(v string) HTMLTextarea { e.setAttr("role", v) return e } func (e *htmlTextarea) Rows(v int) HTMLTextarea { e.setAttr("rows", v) return e } func (e *htmlTextarea) Spellcheck(v bool) HTMLTextarea { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTextarea) Style(k, v string) HTMLTextarea { e.setAttr("style", k+":"+v) return e } func (e *htmlTextarea) Styles(s map[string]string) HTMLTextarea { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTextarea) TabIndex(v int) HTMLTextarea { e.setAttr("tabindex", v) return e } func (e *htmlTextarea) Title(v string) HTMLTextarea { e.setAttr("title", v) return e } func (e *htmlTextarea) Wrap(v string) HTMLTextarea { e.setAttr("wrap", v) return e } func (e *htmlTextarea) On(event string, h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler(event, h, scope...) return e } func (e *htmlTextarea) OnBlur(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTextarea) OnChange(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("change", h, scope...) return e } func (e *htmlTextarea) OnClick(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("click", h, scope...) return e } func (e *htmlTextarea) OnContextMenu(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTextarea) OnCopy(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTextarea) OnCut(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTextarea) OnDblClick(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTextarea) OnDrag(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTextarea) OnDragEnd(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTextarea) OnDragEnter(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTextarea) OnDragLeave(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTextarea) OnDragOver(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTextarea) OnDragStart(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTextarea) OnDrop(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTextarea) OnFocus(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTextarea) OnInput(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("input", h, scope...) return e } func (e *htmlTextarea) OnInvalid(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTextarea) OnKeyDown(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTextarea) OnKeyPress(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTextarea) OnKeyUp(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTextarea) OnMouseDown(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTextarea) OnMouseMove(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTextarea) OnMouseOut(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTextarea) OnMouseOver(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTextarea) OnMouseUp(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTextarea) OnPaste(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTextarea) OnReset(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTextarea) OnScroll(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTextarea) OnSearch(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("search", h, scope...) return e } func (e *htmlTextarea) OnSelect(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("select", h, scope...) return e } func (e *htmlTextarea) OnSubmit(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTextarea) OnWheel(h EventHandler, scope ...any) HTMLTextarea { e.setEventHandler("wheel", h, scope...) return e } // HTMLTFoot is the interface that describes a "tfoot" HTML element. type HTMLTFoot interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTFoot // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTFoot // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTFoot // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTFoot // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTFoot // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTFoot // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTFoot // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTFoot // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTFoot // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTFoot // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTFoot // ID specifies a unique id for an element. ID(v string) HTMLTFoot // Lang specifies the language of the element's content. Lang(v string) HTMLTFoot // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTFoot // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTFoot // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTFoot // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTFoot // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTFoot // Title specifies extra information about an element. Title(v string) HTMLTFoot // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTFoot // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTFoot // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTFoot // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTFoot // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTFoot // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTFoot // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTFoot // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTFoot // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTFoot // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTFoot // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTFoot // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTFoot // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTFoot // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTFoot // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTFoot // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTFoot // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTFoot // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTFoot // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTFoot // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTFoot // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTFoot // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTFoot // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTFoot // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTFoot // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTFoot // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTFoot // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTFoot // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTFoot // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTFoot // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTFoot // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTFoot // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTFoot // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTFoot } // TFoot returns an HTML element that groups the footer content in a table. func TFoot() HTMLTFoot { e := &htmlTFoot{ htmlElement: htmlElement{ tag: "tfoot", isSelfClosing: false, }, } return e } type htmlTFoot struct { htmlElement } func (e *htmlTFoot) Body(v ...UI) HTMLTFoot { e.setChildren(v...) return e } func (e *htmlTFoot) Text(v any) HTMLTFoot { return e.Body(Text(v)) } func (e *htmlTFoot) AccessKey(v string) HTMLTFoot { e.setAttr("accesskey", v) return e } func (e *htmlTFoot) Aria(k string, v any) HTMLTFoot { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTFoot) Attr(n string, v any) HTMLTFoot { e.setAttr(n, v) return e } func (e *htmlTFoot) Class(v ...string) HTMLTFoot { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTFoot) ContentEditable(v bool) HTMLTFoot { e.setAttr("contenteditable", v) return e } func (e *htmlTFoot) DataSet(k string, v any) HTMLTFoot { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTFoot) Dir(v string) HTMLTFoot { e.setAttr("dir", v) return e } func (e *htmlTFoot) Draggable(v bool) HTMLTFoot { e.setAttr("draggable", v) return e } func (e *htmlTFoot) Hidden(v bool) HTMLTFoot { e.setAttr("hidden", v) return e } func (e *htmlTFoot) ID(v string) HTMLTFoot { e.setAttr("id", v) return e } func (e *htmlTFoot) Lang(v string) HTMLTFoot { e.setAttr("lang", v) return e } func (e *htmlTFoot) Role(v string) HTMLTFoot { e.setAttr("role", v) return e } func (e *htmlTFoot) Spellcheck(v bool) HTMLTFoot { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTFoot) Style(k, v string) HTMLTFoot { e.setAttr("style", k+":"+v) return e } func (e *htmlTFoot) Styles(s map[string]string) HTMLTFoot { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTFoot) TabIndex(v int) HTMLTFoot { e.setAttr("tabindex", v) return e } func (e *htmlTFoot) Title(v string) HTMLTFoot { e.setAttr("title", v) return e } func (e *htmlTFoot) On(event string, h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler(event, h, scope...) return e } func (e *htmlTFoot) OnBlur(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTFoot) OnChange(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("change", h, scope...) return e } func (e *htmlTFoot) OnClick(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("click", h, scope...) return e } func (e *htmlTFoot) OnContextMenu(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTFoot) OnCopy(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTFoot) OnCut(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTFoot) OnDblClick(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTFoot) OnDrag(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTFoot) OnDragEnd(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTFoot) OnDragEnter(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTFoot) OnDragLeave(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTFoot) OnDragOver(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTFoot) OnDragStart(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTFoot) OnDrop(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTFoot) OnFocus(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTFoot) OnInput(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("input", h, scope...) return e } func (e *htmlTFoot) OnInvalid(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTFoot) OnKeyDown(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTFoot) OnKeyPress(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTFoot) OnKeyUp(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTFoot) OnMouseDown(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTFoot) OnMouseMove(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTFoot) OnMouseOut(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTFoot) OnMouseOver(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTFoot) OnMouseUp(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTFoot) OnPaste(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTFoot) OnReset(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTFoot) OnScroll(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTFoot) OnSearch(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("search", h, scope...) return e } func (e *htmlTFoot) OnSelect(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("select", h, scope...) return e } func (e *htmlTFoot) OnSubmit(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTFoot) OnWheel(h EventHandler, scope ...any) HTMLTFoot { e.setEventHandler("wheel", h, scope...) return e } // HTMLTh is the interface that describes a "th" HTML element. type HTMLTh interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTh // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTh // Abbr specifies an abbreviated version of the content in a header cell. Abbr(v string) HTMLTh // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTh // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTh // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTh // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTh // ColSpan specifies the number of columns a table cell should span. ColSpan(v int) HTMLTh // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTh // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTh // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTh // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTh // Headers specifies one or more headers cells a cell is related to. Headers(v string) HTMLTh // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTh // ID specifies a unique id for an element. ID(v string) HTMLTh // Lang specifies the language of the element's content. Lang(v string) HTMLTh // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTh // Rowspan specifies the number of rows a table cell should span. Rowspan(v int) HTMLTh // Scope specifies whether a header cell is a header for a column, row, or group of columns or rows. Scope(v string) HTMLTh // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTh // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTh // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTh // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTh // Title specifies extra information about an element. Title(v string) HTMLTh // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTh // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTh // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTh // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTh // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTh // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTh // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTh // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTh // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTh // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTh // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTh // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTh // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTh // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTh // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTh // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTh // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTh // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTh // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTh // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTh // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTh // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTh // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTh // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTh // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTh // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTh // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTh // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTh // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTh // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTh // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTh // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTh // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTh } // Th returns an HTML element that defines a header cell in a table. func Th() HTMLTh { e := &htmlTh{ htmlElement: htmlElement{ tag: "th", isSelfClosing: false, }, } return e } type htmlTh struct { htmlElement } func (e *htmlTh) Body(v ...UI) HTMLTh { e.setChildren(v...) return e } func (e *htmlTh) Text(v any) HTMLTh { return e.Body(Text(v)) } func (e *htmlTh) Abbr(v string) HTMLTh { e.setAttr("abbr", v) return e } func (e *htmlTh) AccessKey(v string) HTMLTh { e.setAttr("accesskey", v) return e } func (e *htmlTh) Aria(k string, v any) HTMLTh { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTh) Attr(n string, v any) HTMLTh { e.setAttr(n, v) return e } func (e *htmlTh) Class(v ...string) HTMLTh { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTh) ColSpan(v int) HTMLTh { e.setAttr("colspan", v) return e } func (e *htmlTh) ContentEditable(v bool) HTMLTh { e.setAttr("contenteditable", v) return e } func (e *htmlTh) DataSet(k string, v any) HTMLTh { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTh) Dir(v string) HTMLTh { e.setAttr("dir", v) return e } func (e *htmlTh) Draggable(v bool) HTMLTh { e.setAttr("draggable", v) return e } func (e *htmlTh) Headers(v string) HTMLTh { e.setAttr("headers", v) return e } func (e *htmlTh) Hidden(v bool) HTMLTh { e.setAttr("hidden", v) return e } func (e *htmlTh) ID(v string) HTMLTh { e.setAttr("id", v) return e } func (e *htmlTh) Lang(v string) HTMLTh { e.setAttr("lang", v) return e } func (e *htmlTh) Role(v string) HTMLTh { e.setAttr("role", v) return e } func (e *htmlTh) Rowspan(v int) HTMLTh { e.setAttr("rowspan", v) return e } func (e *htmlTh) Scope(v string) HTMLTh { e.setAttr("scope", v) return e } func (e *htmlTh) Spellcheck(v bool) HTMLTh { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTh) Style(k, v string) HTMLTh { e.setAttr("style", k+":"+v) return e } func (e *htmlTh) Styles(s map[string]string) HTMLTh { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTh) TabIndex(v int) HTMLTh { e.setAttr("tabindex", v) return e } func (e *htmlTh) Title(v string) HTMLTh { e.setAttr("title", v) return e } func (e *htmlTh) On(event string, h EventHandler, scope ...any) HTMLTh { e.setEventHandler(event, h, scope...) return e } func (e *htmlTh) OnBlur(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTh) OnChange(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("change", h, scope...) return e } func (e *htmlTh) OnClick(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("click", h, scope...) return e } func (e *htmlTh) OnContextMenu(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTh) OnCopy(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTh) OnCut(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTh) OnDblClick(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTh) OnDrag(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTh) OnDragEnd(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTh) OnDragEnter(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTh) OnDragLeave(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTh) OnDragOver(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTh) OnDragStart(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTh) OnDrop(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTh) OnFocus(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTh) OnInput(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("input", h, scope...) return e } func (e *htmlTh) OnInvalid(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTh) OnKeyDown(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTh) OnKeyPress(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTh) OnKeyUp(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTh) OnMouseDown(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTh) OnMouseMove(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTh) OnMouseOut(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTh) OnMouseOver(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTh) OnMouseUp(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTh) OnPaste(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTh) OnReset(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTh) OnScroll(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTh) OnSearch(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("search", h, scope...) return e } func (e *htmlTh) OnSelect(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("select", h, scope...) return e } func (e *htmlTh) OnSubmit(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTh) OnWheel(h EventHandler, scope ...any) HTMLTh { e.setEventHandler("wheel", h, scope...) return e } // HTMLTHead is the interface that describes a "thead" HTML element. type HTMLTHead interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTHead // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTHead // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTHead // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTHead // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTHead // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTHead // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTHead // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTHead // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTHead // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTHead // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTHead // ID specifies a unique id for an element. ID(v string) HTMLTHead // Lang specifies the language of the element's content. Lang(v string) HTMLTHead // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTHead // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTHead // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTHead // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTHead // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTHead // Title specifies extra information about an element. Title(v string) HTMLTHead // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTHead // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTHead // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTHead // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTHead // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTHead // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTHead // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTHead // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTHead // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTHead // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTHead // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTHead // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTHead // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTHead // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTHead // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTHead // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTHead // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTHead // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTHead // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTHead // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTHead // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTHead // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTHead // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTHead // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTHead // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTHead // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTHead // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTHead // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTHead // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTHead // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTHead // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTHead // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTHead // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTHead } // THead returns an HTML element that groups the header content in a table func THead() HTMLTHead { e := &htmlTHead{ htmlElement: htmlElement{ tag: "thead", isSelfClosing: false, }, } return e } type htmlTHead struct { htmlElement } func (e *htmlTHead) Body(v ...UI) HTMLTHead { e.setChildren(v...) return e } func (e *htmlTHead) Text(v any) HTMLTHead { return e.Body(Text(v)) } func (e *htmlTHead) AccessKey(v string) HTMLTHead { e.setAttr("accesskey", v) return e } func (e *htmlTHead) Aria(k string, v any) HTMLTHead { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTHead) Attr(n string, v any) HTMLTHead { e.setAttr(n, v) return e } func (e *htmlTHead) Class(v ...string) HTMLTHead { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTHead) ContentEditable(v bool) HTMLTHead { e.setAttr("contenteditable", v) return e } func (e *htmlTHead) DataSet(k string, v any) HTMLTHead { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTHead) Dir(v string) HTMLTHead { e.setAttr("dir", v) return e } func (e *htmlTHead) Draggable(v bool) HTMLTHead { e.setAttr("draggable", v) return e } func (e *htmlTHead) Hidden(v bool) HTMLTHead { e.setAttr("hidden", v) return e } func (e *htmlTHead) ID(v string) HTMLTHead { e.setAttr("id", v) return e } func (e *htmlTHead) Lang(v string) HTMLTHead { e.setAttr("lang", v) return e } func (e *htmlTHead) Role(v string) HTMLTHead { e.setAttr("role", v) return e } func (e *htmlTHead) Spellcheck(v bool) HTMLTHead { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTHead) Style(k, v string) HTMLTHead { e.setAttr("style", k+":"+v) return e } func (e *htmlTHead) Styles(s map[string]string) HTMLTHead { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTHead) TabIndex(v int) HTMLTHead { e.setAttr("tabindex", v) return e } func (e *htmlTHead) Title(v string) HTMLTHead { e.setAttr("title", v) return e } func (e *htmlTHead) On(event string, h EventHandler, scope ...any) HTMLTHead { e.setEventHandler(event, h, scope...) return e } func (e *htmlTHead) OnBlur(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTHead) OnChange(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("change", h, scope...) return e } func (e *htmlTHead) OnClick(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("click", h, scope...) return e } func (e *htmlTHead) OnContextMenu(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTHead) OnCopy(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTHead) OnCut(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTHead) OnDblClick(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTHead) OnDrag(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTHead) OnDragEnd(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTHead) OnDragEnter(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTHead) OnDragLeave(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTHead) OnDragOver(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTHead) OnDragStart(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTHead) OnDrop(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTHead) OnFocus(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTHead) OnInput(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("input", h, scope...) return e } func (e *htmlTHead) OnInvalid(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTHead) OnKeyDown(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTHead) OnKeyPress(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTHead) OnKeyUp(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTHead) OnMouseDown(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTHead) OnMouseMove(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTHead) OnMouseOut(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTHead) OnMouseOver(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTHead) OnMouseUp(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTHead) OnPaste(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTHead) OnReset(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTHead) OnScroll(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTHead) OnSearch(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("search", h, scope...) return e } func (e *htmlTHead) OnSelect(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("select", h, scope...) return e } func (e *htmlTHead) OnSubmit(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTHead) OnWheel(h EventHandler, scope ...any) HTMLTHead { e.setEventHandler("wheel", h, scope...) return e } // HTMLTime is the interface that describes a "time" HTML element. type HTMLTime interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTime // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTime // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTime // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTime // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTime // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTime // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTime // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTime // DateTime specifies the date and time. DateTime(v string) HTMLTime // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTime // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTime // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTime // ID specifies a unique id for an element. ID(v string) HTMLTime // Lang specifies the language of the element's content. Lang(v string) HTMLTime // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTime // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTime // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTime // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTime // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTime // Title specifies extra information about an element. Title(v string) HTMLTime // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTime // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTime // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTime // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTime // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTime // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTime // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTime // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTime // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTime // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTime // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTime // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTime // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTime // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTime // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTime // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTime // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTime // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTime // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTime // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTime // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTime // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTime // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTime // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTime // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTime // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTime // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTime // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTime // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTime // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTime // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTime // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTime // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTime } // Time returns an HTML element that defines a date/time. func Time() HTMLTime { e := &htmlTime{ htmlElement: htmlElement{ tag: "time", isSelfClosing: false, }, } return e } type htmlTime struct { htmlElement } func (e *htmlTime) Body(v ...UI) HTMLTime { e.setChildren(v...) return e } func (e *htmlTime) Text(v any) HTMLTime { return e.Body(Text(v)) } func (e *htmlTime) AccessKey(v string) HTMLTime { e.setAttr("accesskey", v) return e } func (e *htmlTime) Aria(k string, v any) HTMLTime { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTime) Attr(n string, v any) HTMLTime { e.setAttr(n, v) return e } func (e *htmlTime) Class(v ...string) HTMLTime { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTime) ContentEditable(v bool) HTMLTime { e.setAttr("contenteditable", v) return e } func (e *htmlTime) DataSet(k string, v any) HTMLTime { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTime) DateTime(v string) HTMLTime { e.setAttr("datetime", v) return e } func (e *htmlTime) Dir(v string) HTMLTime { e.setAttr("dir", v) return e } func (e *htmlTime) Draggable(v bool) HTMLTime { e.setAttr("draggable", v) return e } func (e *htmlTime) Hidden(v bool) HTMLTime { e.setAttr("hidden", v) return e } func (e *htmlTime) ID(v string) HTMLTime { e.setAttr("id", v) return e } func (e *htmlTime) Lang(v string) HTMLTime { e.setAttr("lang", v) return e } func (e *htmlTime) Role(v string) HTMLTime { e.setAttr("role", v) return e } func (e *htmlTime) Spellcheck(v bool) HTMLTime { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTime) Style(k, v string) HTMLTime { e.setAttr("style", k+":"+v) return e } func (e *htmlTime) Styles(s map[string]string) HTMLTime { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTime) TabIndex(v int) HTMLTime { e.setAttr("tabindex", v) return e } func (e *htmlTime) Title(v string) HTMLTime { e.setAttr("title", v) return e } func (e *htmlTime) On(event string, h EventHandler, scope ...any) HTMLTime { e.setEventHandler(event, h, scope...) return e } func (e *htmlTime) OnBlur(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTime) OnChange(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("change", h, scope...) return e } func (e *htmlTime) OnClick(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("click", h, scope...) return e } func (e *htmlTime) OnContextMenu(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTime) OnCopy(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTime) OnCut(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTime) OnDblClick(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTime) OnDrag(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTime) OnDragEnd(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTime) OnDragEnter(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTime) OnDragLeave(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTime) OnDragOver(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTime) OnDragStart(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTime) OnDrop(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTime) OnFocus(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTime) OnInput(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("input", h, scope...) return e } func (e *htmlTime) OnInvalid(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTime) OnKeyDown(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTime) OnKeyPress(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTime) OnKeyUp(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTime) OnMouseDown(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTime) OnMouseMove(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTime) OnMouseOut(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTime) OnMouseOver(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTime) OnMouseUp(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTime) OnPaste(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTime) OnReset(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTime) OnScroll(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTime) OnSearch(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("search", h, scope...) return e } func (e *htmlTime) OnSelect(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("select", h, scope...) return e } func (e *htmlTime) OnSubmit(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTime) OnWheel(h EventHandler, scope ...any) HTMLTime { e.setEventHandler("wheel", h, scope...) return e } // HTMLTitle is the interface that describes a "title" HTML element. type HTMLTitle interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTitle // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTitle // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTitle // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTitle // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTitle // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTitle // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTitle // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTitle // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTitle // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTitle // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTitle // ID specifies a unique id for an element. ID(v string) HTMLTitle // Lang specifies the language of the element's content. Lang(v string) HTMLTitle // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTitle // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTitle // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTitle // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTitle // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTitle // Title specifies extra information about an element. Title(v string) HTMLTitle // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTitle } // Title returns an HTML element that defines a title for the document. func Title() HTMLTitle { e := &htmlTitle{ htmlElement: htmlElement{ tag: "title", isSelfClosing: false, }, } return e } type htmlTitle struct { htmlElement } func (e *htmlTitle) Body(v ...UI) HTMLTitle { e.setChildren(v...) return e } func (e *htmlTitle) Text(v any) HTMLTitle { return e.Body(Text(v)) } func (e *htmlTitle) AccessKey(v string) HTMLTitle { e.setAttr("accesskey", v) return e } func (e *htmlTitle) Aria(k string, v any) HTMLTitle { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTitle) Attr(n string, v any) HTMLTitle { e.setAttr(n, v) return e } func (e *htmlTitle) Class(v ...string) HTMLTitle { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTitle) ContentEditable(v bool) HTMLTitle { e.setAttr("contenteditable", v) return e } func (e *htmlTitle) DataSet(k string, v any) HTMLTitle { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTitle) Dir(v string) HTMLTitle { e.setAttr("dir", v) return e } func (e *htmlTitle) Draggable(v bool) HTMLTitle { e.setAttr("draggable", v) return e } func (e *htmlTitle) Hidden(v bool) HTMLTitle { e.setAttr("hidden", v) return e } func (e *htmlTitle) ID(v string) HTMLTitle { e.setAttr("id", v) return e } func (e *htmlTitle) Lang(v string) HTMLTitle { e.setAttr("lang", v) return e } func (e *htmlTitle) Role(v string) HTMLTitle { e.setAttr("role", v) return e } func (e *htmlTitle) Spellcheck(v bool) HTMLTitle { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTitle) Style(k, v string) HTMLTitle { e.setAttr("style", k+":"+v) return e } func (e *htmlTitle) Styles(s map[string]string) HTMLTitle { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTitle) TabIndex(v int) HTMLTitle { e.setAttr("tabindex", v) return e } func (e *htmlTitle) Title(v string) HTMLTitle { e.setAttr("title", v) return e } func (e *htmlTitle) On(event string, h EventHandler, scope ...any) HTMLTitle { e.setEventHandler(event, h, scope...) return e } // HTMLTr is the interface that describes a "tr" HTML element. type HTMLTr interface { UI // Body set the content of the element. Body(elems ...UI) HTMLTr // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLTr // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLTr // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLTr // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLTr // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLTr // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLTr // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLTr // Dir specifies the text direction for the content in an element. Dir(v string) HTMLTr // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLTr // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLTr // ID specifies a unique id for an element. ID(v string) HTMLTr // Lang specifies the language of the element's content. Lang(v string) HTMLTr // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLTr // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLTr // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLTr // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLTr // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLTr // Title specifies extra information about an element. Title(v string) HTMLTr // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLTr // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLTr // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLTr // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLTr // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLTr // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLTr // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLTr // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLTr // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLTr // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLTr // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLTr // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLTr // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLTr // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLTr // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLTr // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLTr // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLTr // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLTr // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLTr // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLTr // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLTr // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLTr // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLTr // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLTr // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLTr // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLTr // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLTr // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLTr // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLTr // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLTr // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLTr // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLTr // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLTr } // Tr returns an HTML element that defines a row in a table. func Tr() HTMLTr { e := &htmlTr{ htmlElement: htmlElement{ tag: "tr", isSelfClosing: false, }, } return e } type htmlTr struct { htmlElement } func (e *htmlTr) Body(v ...UI) HTMLTr { e.setChildren(v...) return e } func (e *htmlTr) Text(v any) HTMLTr { return e.Body(Text(v)) } func (e *htmlTr) AccessKey(v string) HTMLTr { e.setAttr("accesskey", v) return e } func (e *htmlTr) Aria(k string, v any) HTMLTr { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTr) Attr(n string, v any) HTMLTr { e.setAttr(n, v) return e } func (e *htmlTr) Class(v ...string) HTMLTr { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlTr) ContentEditable(v bool) HTMLTr { e.setAttr("contenteditable", v) return e } func (e *htmlTr) DataSet(k string, v any) HTMLTr { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlTr) Dir(v string) HTMLTr { e.setAttr("dir", v) return e } func (e *htmlTr) Draggable(v bool) HTMLTr { e.setAttr("draggable", v) return e } func (e *htmlTr) Hidden(v bool) HTMLTr { e.setAttr("hidden", v) return e } func (e *htmlTr) ID(v string) HTMLTr { e.setAttr("id", v) return e } func (e *htmlTr) Lang(v string) HTMLTr { e.setAttr("lang", v) return e } func (e *htmlTr) Role(v string) HTMLTr { e.setAttr("role", v) return e } func (e *htmlTr) Spellcheck(v bool) HTMLTr { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlTr) Style(k, v string) HTMLTr { e.setAttr("style", k+":"+v) return e } func (e *htmlTr) Styles(s map[string]string) HTMLTr { for k, v := range s { e.Style(k, v) } return e } func (e *htmlTr) TabIndex(v int) HTMLTr { e.setAttr("tabindex", v) return e } func (e *htmlTr) Title(v string) HTMLTr { e.setAttr("title", v) return e } func (e *htmlTr) On(event string, h EventHandler, scope ...any) HTMLTr { e.setEventHandler(event, h, scope...) return e } func (e *htmlTr) OnBlur(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("blur", h, scope...) return e } func (e *htmlTr) OnChange(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("change", h, scope...) return e } func (e *htmlTr) OnClick(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("click", h, scope...) return e } func (e *htmlTr) OnContextMenu(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlTr) OnCopy(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("copy", h, scope...) return e } func (e *htmlTr) OnCut(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("cut", h, scope...) return e } func (e *htmlTr) OnDblClick(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlTr) OnDrag(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("drag", h, scope...) return e } func (e *htmlTr) OnDragEnd(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlTr) OnDragEnter(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlTr) OnDragLeave(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlTr) OnDragOver(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlTr) OnDragStart(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlTr) OnDrop(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("drop", h, scope...) return e } func (e *htmlTr) OnFocus(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("focus", h, scope...) return e } func (e *htmlTr) OnInput(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("input", h, scope...) return e } func (e *htmlTr) OnInvalid(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlTr) OnKeyDown(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlTr) OnKeyPress(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlTr) OnKeyUp(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlTr) OnMouseDown(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlTr) OnMouseMove(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlTr) OnMouseOut(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlTr) OnMouseOver(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlTr) OnMouseUp(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlTr) OnPaste(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("paste", h, scope...) return e } func (e *htmlTr) OnReset(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("reset", h, scope...) return e } func (e *htmlTr) OnScroll(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlTr) OnSearch(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("search", h, scope...) return e } func (e *htmlTr) OnSelect(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("select", h, scope...) return e } func (e *htmlTr) OnSubmit(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("submit", h, scope...) return e } func (e *htmlTr) OnWheel(h EventHandler, scope ...any) HTMLTr { e.setEventHandler("wheel", h, scope...) return e } // HTMLU is the interface that describes a "u" HTML element. type HTMLU interface { UI // Body set the content of the element. Body(elems ...UI) HTMLU // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLU // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLU // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLU // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLU // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLU // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLU // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLU // Dir specifies the text direction for the content in an element. Dir(v string) HTMLU // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLU // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLU // ID specifies a unique id for an element. ID(v string) HTMLU // Lang specifies the language of the element's content. Lang(v string) HTMLU // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLU // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLU // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLU // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLU // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLU // Title specifies extra information about an element. Title(v string) HTMLU // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLU // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLU // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLU // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLU // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLU // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLU // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLU // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLU // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLU // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLU // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLU // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLU // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLU // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLU // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLU // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLU // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLU // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLU // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLU // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLU // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLU // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLU // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLU // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLU // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLU // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLU // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLU // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLU // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLU // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLU // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLU // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLU // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLU } // U returns an HTML element that defines text that should be stylistically different from normal text. func U() HTMLU { e := &htmlU{ htmlElement: htmlElement{ tag: "u", isSelfClosing: false, }, } return e } type htmlU struct { htmlElement } func (e *htmlU) Body(v ...UI) HTMLU { e.setChildren(v...) return e } func (e *htmlU) Text(v any) HTMLU { return e.Body(Text(v)) } func (e *htmlU) AccessKey(v string) HTMLU { e.setAttr("accesskey", v) return e } func (e *htmlU) Aria(k string, v any) HTMLU { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlU) Attr(n string, v any) HTMLU { e.setAttr(n, v) return e } func (e *htmlU) Class(v ...string) HTMLU { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlU) ContentEditable(v bool) HTMLU { e.setAttr("contenteditable", v) return e } func (e *htmlU) DataSet(k string, v any) HTMLU { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlU) Dir(v string) HTMLU { e.setAttr("dir", v) return e } func (e *htmlU) Draggable(v bool) HTMLU { e.setAttr("draggable", v) return e } func (e *htmlU) Hidden(v bool) HTMLU { e.setAttr("hidden", v) return e } func (e *htmlU) ID(v string) HTMLU { e.setAttr("id", v) return e } func (e *htmlU) Lang(v string) HTMLU { e.setAttr("lang", v) return e } func (e *htmlU) Role(v string) HTMLU { e.setAttr("role", v) return e } func (e *htmlU) Spellcheck(v bool) HTMLU { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlU) Style(k, v string) HTMLU { e.setAttr("style", k+":"+v) return e } func (e *htmlU) Styles(s map[string]string) HTMLU { for k, v := range s { e.Style(k, v) } return e } func (e *htmlU) TabIndex(v int) HTMLU { e.setAttr("tabindex", v) return e } func (e *htmlU) Title(v string) HTMLU { e.setAttr("title", v) return e } func (e *htmlU) On(event string, h EventHandler, scope ...any) HTMLU { e.setEventHandler(event, h, scope...) return e } func (e *htmlU) OnBlur(h EventHandler, scope ...any) HTMLU { e.setEventHandler("blur", h, scope...) return e } func (e *htmlU) OnChange(h EventHandler, scope ...any) HTMLU { e.setEventHandler("change", h, scope...) return e } func (e *htmlU) OnClick(h EventHandler, scope ...any) HTMLU { e.setEventHandler("click", h, scope...) return e } func (e *htmlU) OnContextMenu(h EventHandler, scope ...any) HTMLU { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlU) OnCopy(h EventHandler, scope ...any) HTMLU { e.setEventHandler("copy", h, scope...) return e } func (e *htmlU) OnCut(h EventHandler, scope ...any) HTMLU { e.setEventHandler("cut", h, scope...) return e } func (e *htmlU) OnDblClick(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlU) OnDrag(h EventHandler, scope ...any) HTMLU { e.setEventHandler("drag", h, scope...) return e } func (e *htmlU) OnDragEnd(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlU) OnDragEnter(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlU) OnDragLeave(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlU) OnDragOver(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlU) OnDragStart(h EventHandler, scope ...any) HTMLU { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlU) OnDrop(h EventHandler, scope ...any) HTMLU { e.setEventHandler("drop", h, scope...) return e } func (e *htmlU) OnFocus(h EventHandler, scope ...any) HTMLU { e.setEventHandler("focus", h, scope...) return e } func (e *htmlU) OnInput(h EventHandler, scope ...any) HTMLU { e.setEventHandler("input", h, scope...) return e } func (e *htmlU) OnInvalid(h EventHandler, scope ...any) HTMLU { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlU) OnKeyDown(h EventHandler, scope ...any) HTMLU { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlU) OnKeyPress(h EventHandler, scope ...any) HTMLU { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlU) OnKeyUp(h EventHandler, scope ...any) HTMLU { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlU) OnMouseDown(h EventHandler, scope ...any) HTMLU { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlU) OnMouseMove(h EventHandler, scope ...any) HTMLU { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlU) OnMouseOut(h EventHandler, scope ...any) HTMLU { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlU) OnMouseOver(h EventHandler, scope ...any) HTMLU { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlU) OnMouseUp(h EventHandler, scope ...any) HTMLU { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlU) OnPaste(h EventHandler, scope ...any) HTMLU { e.setEventHandler("paste", h, scope...) return e } func (e *htmlU) OnReset(h EventHandler, scope ...any) HTMLU { e.setEventHandler("reset", h, scope...) return e } func (e *htmlU) OnScroll(h EventHandler, scope ...any) HTMLU { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlU) OnSearch(h EventHandler, scope ...any) HTMLU { e.setEventHandler("search", h, scope...) return e } func (e *htmlU) OnSelect(h EventHandler, scope ...any) HTMLU { e.setEventHandler("select", h, scope...) return e } func (e *htmlU) OnSubmit(h EventHandler, scope ...any) HTMLU { e.setEventHandler("submit", h, scope...) return e } func (e *htmlU) OnWheel(h EventHandler, scope ...any) HTMLU { e.setEventHandler("wheel", h, scope...) return e } // HTMLUl is the interface that describes a "ul" HTML element. type HTMLUl interface { UI // Body set the content of the element. Body(elems ...UI) HTMLUl // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLUl // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLUl // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLUl // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLUl // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLUl // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLUl // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLUl // Dir specifies the text direction for the content in an element. Dir(v string) HTMLUl // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLUl // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLUl // ID specifies a unique id for an element. ID(v string) HTMLUl // Lang specifies the language of the element's content. Lang(v string) HTMLUl // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLUl // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLUl // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLUl // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLUl // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLUl // Title specifies extra information about an element. Title(v string) HTMLUl // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLUl // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLUl // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLUl // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLUl // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLUl // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLUl // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLUl // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLUl // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLUl // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLUl // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLUl // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLUl // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLUl // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLUl // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLUl // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLUl // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLUl // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLUl // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLUl // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLUl // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLUl // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLUl // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLUl // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLUl // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLUl // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLUl // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLUl // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLUl // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLUl // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLUl // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLUl // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLUl // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLUl } // Ul returns an HTML element that defines an unordered list. func Ul() HTMLUl { e := &htmlUl{ htmlElement: htmlElement{ tag: "ul", isSelfClosing: false, }, } return e } type htmlUl struct { htmlElement } func (e *htmlUl) Body(v ...UI) HTMLUl { e.setChildren(v...) return e } func (e *htmlUl) Text(v any) HTMLUl { return e.Body(Text(v)) } func (e *htmlUl) AccessKey(v string) HTMLUl { e.setAttr("accesskey", v) return e } func (e *htmlUl) Aria(k string, v any) HTMLUl { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlUl) Attr(n string, v any) HTMLUl { e.setAttr(n, v) return e } func (e *htmlUl) Class(v ...string) HTMLUl { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlUl) ContentEditable(v bool) HTMLUl { e.setAttr("contenteditable", v) return e } func (e *htmlUl) DataSet(k string, v any) HTMLUl { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlUl) Dir(v string) HTMLUl { e.setAttr("dir", v) return e } func (e *htmlUl) Draggable(v bool) HTMLUl { e.setAttr("draggable", v) return e } func (e *htmlUl) Hidden(v bool) HTMLUl { e.setAttr("hidden", v) return e } func (e *htmlUl) ID(v string) HTMLUl { e.setAttr("id", v) return e } func (e *htmlUl) Lang(v string) HTMLUl { e.setAttr("lang", v) return e } func (e *htmlUl) Role(v string) HTMLUl { e.setAttr("role", v) return e } func (e *htmlUl) Spellcheck(v bool) HTMLUl { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlUl) Style(k, v string) HTMLUl { e.setAttr("style", k+":"+v) return e } func (e *htmlUl) Styles(s map[string]string) HTMLUl { for k, v := range s { e.Style(k, v) } return e } func (e *htmlUl) TabIndex(v int) HTMLUl { e.setAttr("tabindex", v) return e } func (e *htmlUl) Title(v string) HTMLUl { e.setAttr("title", v) return e } func (e *htmlUl) On(event string, h EventHandler, scope ...any) HTMLUl { e.setEventHandler(event, h, scope...) return e } func (e *htmlUl) OnBlur(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("blur", h, scope...) return e } func (e *htmlUl) OnChange(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("change", h, scope...) return e } func (e *htmlUl) OnClick(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("click", h, scope...) return e } func (e *htmlUl) OnContextMenu(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlUl) OnCopy(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("copy", h, scope...) return e } func (e *htmlUl) OnCut(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("cut", h, scope...) return e } func (e *htmlUl) OnDblClick(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlUl) OnDrag(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("drag", h, scope...) return e } func (e *htmlUl) OnDragEnd(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlUl) OnDragEnter(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlUl) OnDragLeave(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlUl) OnDragOver(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlUl) OnDragStart(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlUl) OnDrop(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("drop", h, scope...) return e } func (e *htmlUl) OnFocus(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("focus", h, scope...) return e } func (e *htmlUl) OnInput(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("input", h, scope...) return e } func (e *htmlUl) OnInvalid(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlUl) OnKeyDown(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlUl) OnKeyPress(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlUl) OnKeyUp(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlUl) OnMouseDown(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlUl) OnMouseMove(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlUl) OnMouseOut(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlUl) OnMouseOver(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlUl) OnMouseUp(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlUl) OnPaste(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("paste", h, scope...) return e } func (e *htmlUl) OnReset(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("reset", h, scope...) return e } func (e *htmlUl) OnScroll(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlUl) OnSearch(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("search", h, scope...) return e } func (e *htmlUl) OnSelect(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("select", h, scope...) return e } func (e *htmlUl) OnSubmit(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("submit", h, scope...) return e } func (e *htmlUl) OnWheel(h EventHandler, scope ...any) HTMLUl { e.setEventHandler("wheel", h, scope...) return e } // HTMLVar is the interface that describes a "var" HTML element. type HTMLVar interface { UI // Body set the content of the element. Body(elems ...UI) HTMLVar // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLVar // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLVar // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLVar // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLVar // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLVar // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLVar // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLVar // Dir specifies the text direction for the content in an element. Dir(v string) HTMLVar // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLVar // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLVar // ID specifies a unique id for an element. ID(v string) HTMLVar // Lang specifies the language of the element's content. Lang(v string) HTMLVar // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLVar // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLVar // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLVar // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLVar // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLVar // Title specifies extra information about an element. Title(v string) HTMLVar // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLVar // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLVar // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLVar // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLVar // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLVar // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLVar // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLVar // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLVar // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLVar // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLVar // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLVar // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLVar // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLVar // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLVar // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLVar // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLVar // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLVar // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLVar // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLVar // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLVar // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLVar // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLVar // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLVar // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLVar // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLVar // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLVar // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLVar // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLVar // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLVar // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLVar // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLVar // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLVar // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLVar } // Var returns an HTML element that defines a variable. func Var() HTMLVar { e := &htmlVar{ htmlElement: htmlElement{ tag: "var", isSelfClosing: false, }, } return e } type htmlVar struct { htmlElement } func (e *htmlVar) Body(v ...UI) HTMLVar { e.setChildren(v...) return e } func (e *htmlVar) Text(v any) HTMLVar { return e.Body(Text(v)) } func (e *htmlVar) AccessKey(v string) HTMLVar { e.setAttr("accesskey", v) return e } func (e *htmlVar) Aria(k string, v any) HTMLVar { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlVar) Attr(n string, v any) HTMLVar { e.setAttr(n, v) return e } func (e *htmlVar) Class(v ...string) HTMLVar { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlVar) ContentEditable(v bool) HTMLVar { e.setAttr("contenteditable", v) return e } func (e *htmlVar) DataSet(k string, v any) HTMLVar { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlVar) Dir(v string) HTMLVar { e.setAttr("dir", v) return e } func (e *htmlVar) Draggable(v bool) HTMLVar { e.setAttr("draggable", v) return e } func (e *htmlVar) Hidden(v bool) HTMLVar { e.setAttr("hidden", v) return e } func (e *htmlVar) ID(v string) HTMLVar { e.setAttr("id", v) return e } func (e *htmlVar) Lang(v string) HTMLVar { e.setAttr("lang", v) return e } func (e *htmlVar) Role(v string) HTMLVar { e.setAttr("role", v) return e } func (e *htmlVar) Spellcheck(v bool) HTMLVar { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlVar) Style(k, v string) HTMLVar { e.setAttr("style", k+":"+v) return e } func (e *htmlVar) Styles(s map[string]string) HTMLVar { for k, v := range s { e.Style(k, v) } return e } func (e *htmlVar) TabIndex(v int) HTMLVar { e.setAttr("tabindex", v) return e } func (e *htmlVar) Title(v string) HTMLVar { e.setAttr("title", v) return e } func (e *htmlVar) On(event string, h EventHandler, scope ...any) HTMLVar { e.setEventHandler(event, h, scope...) return e } func (e *htmlVar) OnBlur(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("blur", h, scope...) return e } func (e *htmlVar) OnChange(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("change", h, scope...) return e } func (e *htmlVar) OnClick(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("click", h, scope...) return e } func (e *htmlVar) OnContextMenu(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlVar) OnCopy(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("copy", h, scope...) return e } func (e *htmlVar) OnCut(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("cut", h, scope...) return e } func (e *htmlVar) OnDblClick(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlVar) OnDrag(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("drag", h, scope...) return e } func (e *htmlVar) OnDragEnd(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlVar) OnDragEnter(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlVar) OnDragLeave(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlVar) OnDragOver(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlVar) OnDragStart(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlVar) OnDrop(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("drop", h, scope...) return e } func (e *htmlVar) OnFocus(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("focus", h, scope...) return e } func (e *htmlVar) OnInput(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("input", h, scope...) return e } func (e *htmlVar) OnInvalid(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlVar) OnKeyDown(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlVar) OnKeyPress(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlVar) OnKeyUp(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlVar) OnMouseDown(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlVar) OnMouseMove(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlVar) OnMouseOut(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlVar) OnMouseOver(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlVar) OnMouseUp(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlVar) OnPaste(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("paste", h, scope...) return e } func (e *htmlVar) OnReset(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("reset", h, scope...) return e } func (e *htmlVar) OnScroll(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlVar) OnSearch(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("search", h, scope...) return e } func (e *htmlVar) OnSelect(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("select", h, scope...) return e } func (e *htmlVar) OnSubmit(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("submit", h, scope...) return e } func (e *htmlVar) OnWheel(h EventHandler, scope ...any) HTMLVar { e.setEventHandler("wheel", h, scope...) return e } // HTMLVideo is the interface that describes a "video" HTML element. type HTMLVideo interface { UI // Body set the content of the element. Body(elems ...UI) HTMLVideo // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLVideo // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLVideo // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLVideo // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLVideo // AutoPlay specifies that the audio/video will start playing as soon as it is ready. AutoPlay(v bool) HTMLVideo // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLVideo // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLVideo // Controls specifies that audio/video controls should be displayed (such as a play/pause button etc). Controls(v bool) HTMLVideo // CrossOrigin sets the mode of the request to an HTTP CORS Request. CrossOrigin(v string) HTMLVideo // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLVideo // Dir specifies the text direction for the content in an element. Dir(v string) HTMLVideo // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLVideo // Height specifies the height of the element (in pixels). Height(v int) HTMLVideo // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLVideo // ID specifies a unique id for an element. ID(v string) HTMLVideo // Lang specifies the language of the element's content. Lang(v string) HTMLVideo // Loop specifies that the audio/video will start over again, every time it is finished. Loop(v bool) HTMLVideo // Muted specifies that the audio output of the video should be muted. Muted(v bool) HTMLVideo // Poster specifies an image to be shown while the video is downloading, or until the user hits the play button. Poster(v string) HTMLVideo // Preload specifies if and how the author thinks the audio/video should be loaded when the page loads. Preload(v string) HTMLVideo // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLVideo // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLVideo // Src specifies the URL of the media file. Src(v string) HTMLVideo // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLVideo // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLVideo // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLVideo // Title specifies extra information about an element. Title(v string) HTMLVideo // Width specifies the width of the element. Width(v int) HTMLVideo // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLVideo // OnAbort calls the given handler on abort. OnAbort(h EventHandler, scope ...any) HTMLVideo // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLVideo // OnCanPlay calls the given handler when a file is ready to start playing (when it has buffered enough to begin). OnCanPlay(h EventHandler, scope ...any) HTMLVideo // OnCanPlayThrough calls the given handler when a file can be played all the way to the end without pausing for buffering. OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLVideo // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLVideo // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLVideo // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLVideo // OnCueChange calls the given handler when the cue changes in a track element. OnCueChange(h EventHandler, scope ...any) HTMLVideo // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLVideo // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLVideo // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLVideo // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLVideo // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLVideo // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLVideo // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLVideo // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLVideo // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLVideo // OnDurationChange calls the given handler when the length of the media changes. OnDurationChange(h EventHandler, scope ...any) HTMLVideo // OnEmptied calls the given handler when something bad happens and the file is suddenly unavailable (like unexpectedly disconnects). OnEmptied(h EventHandler, scope ...any) HTMLVideo // OnEnded calls the given handler when the media has reach the end. OnEnded(h EventHandler, scope ...any) HTMLVideo // OnError calls the given handler when an error occurs. OnError(h EventHandler, scope ...any) HTMLVideo // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLVideo // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLVideo // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLVideo // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLVideo // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLVideo // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLVideo // OnLoadStart calls the given handler just as the file begins to load before anything is actually loaded. OnLoadStart(h EventHandler, scope ...any) HTMLVideo // OnLoadedData calls the given handler when media data is loaded. OnLoadedData(h EventHandler, scope ...any) HTMLVideo // OnLoadedMetaData calls the given handler when meta data (like dimensions and duration) are loaded. OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLVideo // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLVideo // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLVideo // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLVideo // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLVideo // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLVideo // OnPause calls the given handler when the media is paused either by the user or programmatically. OnPause(h EventHandler, scope ...any) HTMLVideo // OnPlay calls the given handler when the media is ready to start playing. OnPlay(h EventHandler, scope ...any) HTMLVideo // OnPlaying calls the given handler when the media actually has started playing. OnPlaying(h EventHandler, scope ...any) HTMLVideo // OnProgress calls the given handler when the browser is in the process of getting the media data. OnProgress(h EventHandler, scope ...any) HTMLVideo // OnRateChange calls the given handler each time the playback rate changes (like when a user switches to a slow motion or fast forward mode). OnRateChange(h EventHandler, scope ...any) HTMLVideo // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLVideo // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLVideo // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLVideo // OnSeeked calls the given handler when the seeking attribute is set to false indicating that seeking has ended. OnSeeked(h EventHandler, scope ...any) HTMLVideo // OnSeeking calls the given handler when the seeking attribute is set to true indicating that seeking is active. OnSeeking(h EventHandler, scope ...any) HTMLVideo // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLVideo // OnStalled calls the given handler when the browser is unable to fetch the media data for whatever reason. OnStalled(h EventHandler, scope ...any) HTMLVideo // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLVideo // OnSuspend calls the given handler when fetching the media data is stopped before it is completely loaded for whatever reason. OnSuspend(h EventHandler, scope ...any) HTMLVideo // OnTimeUpdate calls the given handler when the playing position has changed (like when the user fast forwards to a different point in the media). OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo // OnVolumeChange calls the given handler each time the volume is changed which (includes setting the volume to "mute"). OnVolumeChange(h EventHandler, scope ...any) HTMLVideo // OnWaiting calls the given handler when the media has paused but is expected to resume (like when the media pauses to buffer more data). OnWaiting(h EventHandler, scope ...any) HTMLVideo // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLVideo } // Video returns an HTML element that defines a video or movie. func Video() HTMLVideo { e := &htmlVideo{ htmlElement: htmlElement{ tag: "video", isSelfClosing: false, }, } return e } type htmlVideo struct { htmlElement } func (e *htmlVideo) Body(v ...UI) HTMLVideo { e.setChildren(v...) return e } func (e *htmlVideo) Text(v any) HTMLVideo { return e.Body(Text(v)) } func (e *htmlVideo) AccessKey(v string) HTMLVideo { e.setAttr("accesskey", v) return e } func (e *htmlVideo) Aria(k string, v any) HTMLVideo { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlVideo) Attr(n string, v any) HTMLVideo { e.setAttr(n, v) return e } func (e *htmlVideo) AutoPlay(v bool) HTMLVideo { e.setAttr("autoplay", v) return e } func (e *htmlVideo) Class(v ...string) HTMLVideo { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlVideo) ContentEditable(v bool) HTMLVideo { e.setAttr("contenteditable", v) return e } func (e *htmlVideo) Controls(v bool) HTMLVideo { e.setAttr("controls", v) return e } func (e *htmlVideo) CrossOrigin(v string) HTMLVideo { e.setAttr("crossorigin", v) return e } func (e *htmlVideo) DataSet(k string, v any) HTMLVideo { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlVideo) Dir(v string) HTMLVideo { e.setAttr("dir", v) return e } func (e *htmlVideo) Draggable(v bool) HTMLVideo { e.setAttr("draggable", v) return e } func (e *htmlVideo) Height(v int) HTMLVideo { e.setAttr("height", v) return e } func (e *htmlVideo) Hidden(v bool) HTMLVideo { e.setAttr("hidden", v) return e } func (e *htmlVideo) ID(v string) HTMLVideo { e.setAttr("id", v) return e } func (e *htmlVideo) Lang(v string) HTMLVideo { e.setAttr("lang", v) return e } func (e *htmlVideo) Loop(v bool) HTMLVideo { e.setAttr("loop", v) return e } func (e *htmlVideo) Muted(v bool) HTMLVideo { e.setAttr("muted", v) return e } func (e *htmlVideo) Poster(v string) HTMLVideo { e.setAttr("poster", v) return e } func (e *htmlVideo) Preload(v string) HTMLVideo { e.setAttr("preload", v) return e } func (e *htmlVideo) Role(v string) HTMLVideo { e.setAttr("role", v) return e } func (e *htmlVideo) Spellcheck(v bool) HTMLVideo { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlVideo) Src(v string) HTMLVideo { e.setAttr("src", v) return e } func (e *htmlVideo) Style(k, v string) HTMLVideo { e.setAttr("style", k+":"+v) return e } func (e *htmlVideo) Styles(s map[string]string) HTMLVideo { for k, v := range s { e.Style(k, v) } return e } func (e *htmlVideo) TabIndex(v int) HTMLVideo { e.setAttr("tabindex", v) return e } func (e *htmlVideo) Title(v string) HTMLVideo { e.setAttr("title", v) return e } func (e *htmlVideo) Width(v int) HTMLVideo { e.setAttr("width", v) return e } func (e *htmlVideo) On(event string, h EventHandler, scope ...any) HTMLVideo { e.setEventHandler(event, h, scope...) return e } func (e *htmlVideo) OnAbort(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("abort", h, scope...) return e } func (e *htmlVideo) OnBlur(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("blur", h, scope...) return e } func (e *htmlVideo) OnCanPlay(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("canplay", h, scope...) return e } func (e *htmlVideo) OnCanPlayThrough(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("canplaythrough", h, scope...) return e } func (e *htmlVideo) OnChange(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("change", h, scope...) return e } func (e *htmlVideo) OnClick(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("click", h, scope...) return e } func (e *htmlVideo) OnContextMenu(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlVideo) OnCopy(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("copy", h, scope...) return e } func (e *htmlVideo) OnCueChange(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("cuechange", h, scope...) return e } func (e *htmlVideo) OnCut(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("cut", h, scope...) return e } func (e *htmlVideo) OnDblClick(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlVideo) OnDrag(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("drag", h, scope...) return e } func (e *htmlVideo) OnDragEnd(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlVideo) OnDragEnter(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlVideo) OnDragLeave(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlVideo) OnDragOver(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlVideo) OnDragStart(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlVideo) OnDrop(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("drop", h, scope...) return e } func (e *htmlVideo) OnDurationChange(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("durationchange", h, scope...) return e } func (e *htmlVideo) OnEmptied(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("emptied", h, scope...) return e } func (e *htmlVideo) OnEnded(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("ended", h, scope...) return e } func (e *htmlVideo) OnError(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("error", h, scope...) return e } func (e *htmlVideo) OnFocus(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("focus", h, scope...) return e } func (e *htmlVideo) OnInput(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("input", h, scope...) return e } func (e *htmlVideo) OnInvalid(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlVideo) OnKeyDown(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlVideo) OnKeyPress(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlVideo) OnKeyUp(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlVideo) OnLoadStart(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("loadstart", h, scope...) return e } func (e *htmlVideo) OnLoadedData(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("loadeddata", h, scope...) return e } func (e *htmlVideo) OnLoadedMetaData(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("loadedmetadata", h, scope...) return e } func (e *htmlVideo) OnMouseDown(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlVideo) OnMouseMove(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlVideo) OnMouseOut(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlVideo) OnMouseOver(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlVideo) OnMouseUp(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlVideo) OnPaste(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("paste", h, scope...) return e } func (e *htmlVideo) OnPause(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("pause", h, scope...) return e } func (e *htmlVideo) OnPlay(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("play", h, scope...) return e } func (e *htmlVideo) OnPlaying(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("playing", h, scope...) return e } func (e *htmlVideo) OnProgress(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("progress", h, scope...) return e } func (e *htmlVideo) OnRateChange(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("ratechange", h, scope...) return e } func (e *htmlVideo) OnReset(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("reset", h, scope...) return e } func (e *htmlVideo) OnScroll(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlVideo) OnSearch(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("search", h, scope...) return e } func (e *htmlVideo) OnSeeked(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("seeked", h, scope...) return e } func (e *htmlVideo) OnSeeking(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("seeking", h, scope...) return e } func (e *htmlVideo) OnSelect(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("select", h, scope...) return e } func (e *htmlVideo) OnStalled(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("stalled", h, scope...) return e } func (e *htmlVideo) OnSubmit(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("submit", h, scope...) return e } func (e *htmlVideo) OnSuspend(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("suspend", h, scope...) return e } func (e *htmlVideo) OnTimeUpdate(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("timeupdate", h, scope...) return e } func (e *htmlVideo) OnVolumeChange(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("volumechange", h, scope...) return e } func (e *htmlVideo) OnWaiting(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("waiting", h, scope...) return e } func (e *htmlVideo) OnWheel(h EventHandler, scope ...any) HTMLVideo { e.setEventHandler("wheel", h, scope...) return e } // HTMLWbr is the interface that describes a "wbr" HTML element. type HTMLWbr interface { UI // Body set the content of the element. Body(elems ...UI) HTMLWbr // Text sets the content of the element with a text node containing the stringified given value. Text(v any) HTMLWbr // AccessKey specifies a shortcut key to activate/focus an element. AccessKey(v string) HTMLWbr // Aria stores accessible rich internet applications (ARIA) data. Aria(k string, v any) HTMLWbr // Attr sets the named attribute with the given value. Attr(n string, v any) HTMLWbr // Class specifies one or more classnames for an element (refers to a class in a style sheet). Class(v ...string) HTMLWbr // ContentEditable specifies whether the content of an element is editable or not. ContentEditable(v bool) HTMLWbr // DataSet stores custom data private to the page or application. DataSet(k string, v any) HTMLWbr // Dir specifies the text direction for the content in an element. Dir(v string) HTMLWbr // Draggable specifies whether an element is draggable or not. Draggable(v bool) HTMLWbr // Hidden specifies that an element is not yet, or is no longer relevant. Hidden(v bool) HTMLWbr // ID specifies a unique id for an element. ID(v string) HTMLWbr // Lang specifies the language of the element's content. Lang(v string) HTMLWbr // Role specifies to parsing software the exact function of an element (and its children). Role(v string) HTMLWbr // Spellcheck specifies whether the element is to have its spelling and grammar checked or not. Spellcheck(v bool) HTMLWbr // Style specifies a CSS style for an element. Can be called multiple times to set multiple css styles. Style(k, v string) HTMLWbr // Styles specifies CSS styles for an element. Can be called multiple times to set multiple css styles. Styles(s map[string]string) HTMLWbr // TabIndex specifies the tabbing order of an element. TabIndex(v int) HTMLWbr // Title specifies extra information about an element. Title(v string) HTMLWbr // On registers the given event handler to the specified event. On(event string, h EventHandler, scope ...any) HTMLWbr // OnBlur calls the given handler when the element loses focus. OnBlur(h EventHandler, scope ...any) HTMLWbr // OnChange calls the given handler when the value of the element is changed. OnChange(h EventHandler, scope ...any) HTMLWbr // OnClick calls the given handler when there is a mouse click on the element. OnClick(h EventHandler, scope ...any) HTMLWbr // OnContextMenu calls the given handler when a context menu is triggered. OnContextMenu(h EventHandler, scope ...any) HTMLWbr // OnCopy calls the given handler when the user copies the content of an element. OnCopy(h EventHandler, scope ...any) HTMLWbr // OnCut calls the given handler when the user cuts the content of an element. OnCut(h EventHandler, scope ...any) HTMLWbr // OnDblClick calls the given handler when there is a mouse double-click on the element. OnDblClick(h EventHandler, scope ...any) HTMLWbr // OnDrag calls the given handler when an element is dragged. OnDrag(h EventHandler, scope ...any) HTMLWbr // OnDragEnd calls the given handler at the end of a drag operation. OnDragEnd(h EventHandler, scope ...any) HTMLWbr // OnDragEnter calls the given handler when an element has been dragged to a valid drop target. OnDragEnter(h EventHandler, scope ...any) HTMLWbr // OnDragLeave calls the given handler when an element leaves a valid drop target. OnDragLeave(h EventHandler, scope ...any) HTMLWbr // OnDragOver calls the given handler when an element is being dragged over a valid drop target. OnDragOver(h EventHandler, scope ...any) HTMLWbr // OnDragStart calls the given handler at the start of a drag operation. OnDragStart(h EventHandler, scope ...any) HTMLWbr // OnDrop calls the given handler when dragged element is being dropped. OnDrop(h EventHandler, scope ...any) HTMLWbr // OnFocus calls the given handler when the element gets focus. OnFocus(h EventHandler, scope ...any) HTMLWbr // OnInput calls the given handler when an element gets user input. OnInput(h EventHandler, scope ...any) HTMLWbr // OnInvalid calls the given handler when an element is invalid. OnInvalid(h EventHandler, scope ...any) HTMLWbr // OnKeyDown calls the given handler when a user is pressing a key. OnKeyDown(h EventHandler, scope ...any) HTMLWbr // OnKeyPress calls the given handler when a user presses a key. OnKeyPress(h EventHandler, scope ...any) HTMLWbr // OnKeyUp calls the given handler when a user releases a key. OnKeyUp(h EventHandler, scope ...any) HTMLWbr // OnMouseDown calls the given handler when a mouse button is pressed down on an element. OnMouseDown(h EventHandler, scope ...any) HTMLWbr // OnMouseMove calls the given handler when the mouse pointer is moving while it is over an element. OnMouseMove(h EventHandler, scope ...any) HTMLWbr // OnMouseOut calls the given handler when the mouse pointer moves out of an element. OnMouseOut(h EventHandler, scope ...any) HTMLWbr // OnMouseOver calls the given handler when the mouse pointer moves over an element. OnMouseOver(h EventHandler, scope ...any) HTMLWbr // OnMouseUp calls the given handler when a mouse button is released over an element. OnMouseUp(h EventHandler, scope ...any) HTMLWbr // OnPaste calls the given handler when the user pastes some content in an element. OnPaste(h EventHandler, scope ...any) HTMLWbr // OnReset calls the given handler when the Reset button in a form is clicked. OnReset(h EventHandler, scope ...any) HTMLWbr // OnScroll calls the given handler when an element's scrollbar is being scrolled. OnScroll(h EventHandler, scope ...any) HTMLWbr // OnSearch calls the given handler when the user writes something in a search field. OnSearch(h EventHandler, scope ...any) HTMLWbr // OnSelect calls the given handler after some text has been selected in an element. OnSelect(h EventHandler, scope ...any) HTMLWbr // OnSubmit calls the given handler when a form is submitted. OnSubmit(h EventHandler, scope ...any) HTMLWbr // OnWheel calls the given handler when the mouse wheel rolls up or down over an element. OnWheel(h EventHandler, scope ...any) HTMLWbr } // Wbr returns an HTML element that defines a possible line-break. func Wbr() HTMLWbr { e := &htmlWbr{ htmlElement: htmlElement{ tag: "wbr", isSelfClosing: false, }, } return e } type htmlWbr struct { htmlElement } func (e *htmlWbr) Body(v ...UI) HTMLWbr { e.setChildren(v...) return e } func (e *htmlWbr) Text(v any) HTMLWbr { return e.Body(Text(v)) } func (e *htmlWbr) AccessKey(v string) HTMLWbr { e.setAttr("accesskey", v) return e } func (e *htmlWbr) Aria(k string, v any) HTMLWbr { e.setAttr("aria-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlWbr) Attr(n string, v any) HTMLWbr { e.setAttr(n, v) return e } func (e *htmlWbr) Class(v ...string) HTMLWbr { e.setAttr("class", strings.Join(v, " ")) return e } func (e *htmlWbr) ContentEditable(v bool) HTMLWbr { e.setAttr("contenteditable", v) return e } func (e *htmlWbr) DataSet(k string, v any) HTMLWbr { e.setAttr("data-"+k, fmt.Sprintf("%v", v)) return e } func (e *htmlWbr) Dir(v string) HTMLWbr { e.setAttr("dir", v) return e } func (e *htmlWbr) Draggable(v bool) HTMLWbr { e.setAttr("draggable", v) return e } func (e *htmlWbr) Hidden(v bool) HTMLWbr { e.setAttr("hidden", v) return e } func (e *htmlWbr) ID(v string) HTMLWbr { e.setAttr("id", v) return e } func (e *htmlWbr) Lang(v string) HTMLWbr { e.setAttr("lang", v) return e } func (e *htmlWbr) Role(v string) HTMLWbr { e.setAttr("role", v) return e } func (e *htmlWbr) Spellcheck(v bool) HTMLWbr { s := "false" if v { s = "true" } e.setAttr("spellcheck", s) return e } func (e *htmlWbr) Style(k, v string) HTMLWbr { e.setAttr("style", k+":"+v) return e } func (e *htmlWbr) Styles(s map[string]string) HTMLWbr { for k, v := range s { e.Style(k, v) } return e } func (e *htmlWbr) TabIndex(v int) HTMLWbr { e.setAttr("tabindex", v) return e } func (e *htmlWbr) Title(v string) HTMLWbr { e.setAttr("title", v) return e } func (e *htmlWbr) On(event string, h EventHandler, scope ...any) HTMLWbr { e.setEventHandler(event, h, scope...) return e } func (e *htmlWbr) OnBlur(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("blur", h, scope...) return e } func (e *htmlWbr) OnChange(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("change", h, scope...) return e } func (e *htmlWbr) OnClick(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("click", h, scope...) return e } func (e *htmlWbr) OnContextMenu(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("contextmenu", h, scope...) return e } func (e *htmlWbr) OnCopy(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("copy", h, scope...) return e } func (e *htmlWbr) OnCut(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("cut", h, scope...) return e } func (e *htmlWbr) OnDblClick(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dblclick", h, scope...) return e } func (e *htmlWbr) OnDrag(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("drag", h, scope...) return e } func (e *htmlWbr) OnDragEnd(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dragend", h, scope...) return e } func (e *htmlWbr) OnDragEnter(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dragenter", h, scope...) return e } func (e *htmlWbr) OnDragLeave(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dragleave", h, scope...) return e } func (e *htmlWbr) OnDragOver(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dragover", h, scope...) return e } func (e *htmlWbr) OnDragStart(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("dragstart", h, scope...) return e } func (e *htmlWbr) OnDrop(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("drop", h, scope...) return e } func (e *htmlWbr) OnFocus(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("focus", h, scope...) return e } func (e *htmlWbr) OnInput(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("input", h, scope...) return e } func (e *htmlWbr) OnInvalid(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("invalid", h, scope...) return e } func (e *htmlWbr) OnKeyDown(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("keydown", h, scope...) return e } func (e *htmlWbr) OnKeyPress(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("keypress", h, scope...) return e } func (e *htmlWbr) OnKeyUp(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("keyup", h, scope...) return e } func (e *htmlWbr) OnMouseDown(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("mousedown", h, scope...) return e } func (e *htmlWbr) OnMouseMove(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("mousemove", h, scope...) return e } func (e *htmlWbr) OnMouseOut(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("mouseout", h, scope...) return e } func (e *htmlWbr) OnMouseOver(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("mouseover", h, scope...) return e } func (e *htmlWbr) OnMouseUp(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("mouseup", h, scope...) return e } func (e *htmlWbr) OnPaste(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("paste", h, scope...) return e } func (e *htmlWbr) OnReset(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("reset", h, scope...) return e } func (e *htmlWbr) OnScroll(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("scroll", h, scope...) return e } func (e *htmlWbr) OnSearch(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("search", h, scope...) return e } func (e *htmlWbr) OnSelect(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("select", h, scope...) return e } func (e *htmlWbr) OnSubmit(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("submit", h, scope...) return e } func (e *htmlWbr) OnWheel(h EventHandler, scope ...any) HTMLWbr { e.setEventHandler("wheel", h, scope...) return e }