Rest
...children: ValidTagChild[]Do not modify directly, use helper methods in the tag instead.
Readonly
lengthReadonly
nameReturns the name of the function. Function names are read-only and can not be changed.
Attach to the currently attached tag in the global hobo context
Same as .a - Attach to the currently attached tag in the global hobo context
Get the tag id
Determines whether the given value inherits from this function if this function was used as a constructor function.
A constructor function can control which objects are recognized as its instances by 'instanceof' by overriding this method.
Shorthand for .addAttr method. Adds attribute, and returns a new TagBuilder
Shorthand for .addClass method. Adds classNames to this TagBuilder, and returns a new TagBuilder
Rest
...classNames: string[]Add one attribute, and return a new TagBuilder
Adds classNames to this TagBuilder, and returns a new TagBuilder
Rest
...classNames: string[]Adds a single style, and returns a new TagBuilder
Adds tags as children if the tag can have children.
For example, if tag is img
there's no need to add the childre as they will not be generated.
Rest
...tags: ValidTagChild[]Calls the function, substituting the specified object for the this value of the function, and the specified array for the arguments of the function.
The object to be used as the this object.
Optional
argArray: anyA set of arguments to be passed to the function.
Shorthand for .addStyle method Adds a single style, and returns a new TagBuilder
For a given function, creates a bound function that has the same body as the original function. The this object of the bound function is associated with the specified object, and has the specified initial parameters.
An object to which the this keyword can refer inside the new function.
Rest
...argArray: any[]A list of arguments to be passed to the new function.
Private
getSet the id of the tag Can't be empty
Private
isPrivate
iscm = modify
calls fn
with the tag, and returns the tag
usefull to change a tag while maintaing chaning
div().m(t => t.className.add("Container"))
.div("I'm a child!"),
div([
p("Child1").m(t => t.className.add("child-1")),
p("Child1").m(t => t.className.add("child-2"))
])
Shortcut for method .modClass
Modifies the classnames of a tag. Similar to the .mod
or .m
methods
but it passes the className instead of the complete tag.
Retuns a new TagBuilder
calls fn
with the tag, and returns the tag
usefull to change a tag while maintaing chaning
div().m(t => t.className.add("Container"))
.div("I'm a child!"),
div([
p("Child1").mod(t => t.className.add("child-1")),
p("Child1").mod(t => t.className.add("child-2"))
])
Modifies the classnames of a tag. Similar to the .mod
or .m
methods
but it passes the className instead of the complete tag.
Retuns a new TagBuilder
div(
p("Child1").modClass(c => c.add("child-1")),
p("Child1").modClass(c => c.add("child-2"))
)
Set the parent of the tag. If a parent is set, this tag will be added as a child when built
Shorthand for .removeAttr method. Removes attribute from this TagBuilder, and returns a new TagBuilder
Rest
...attr: string[]Shorthand for .rmClass method. Removes classNames from this TagBuilder, and returns a new TagBuilder
Rest
...classNames: string[]Removes attribute from this TagBuilder, and returns a new TagBuilder
Rest
...attr: string[]Removes classNames from this TagBuilder, and returns a new TagBuilder
Rest
...classNames: string[]Removes styles from this TagBuilder, and returns a new TagBuilder
Rest
...styleNames: string[]Shorthand for .removeStyles method. Removes styles from this TagBuilder, and returns a new TagBuilder
Rest
...styleNames: string[]Shorthand for .setAttr method. Sets multiple atributes at once, and returns a new TagBuilder
Private
sanitizeSets multiple atributes at once, and returns a new TagBuilder
Set the children of this tag. Replaces any current children
Adds style from object, and returns a new TagBuilder
Sets and validates the tag name
Shorthand for .setStyles method. Adds style from object, and returns a new TagBuilder
Store metadata inside tag. Internal method, you won't need this
replaces the children of this tag with the provided string
Private
validateGenerated using TypeDoc
TagBuilder class, used to build tags of course.