Class: HtmlTag

HtmlTag


new HtmlTag(name, publicId, options)

Represents an HTML (DOM) tag

Parameters:
Name Type Argument Description
name String

the name of the tag

publicId String <optional>
options Object
Example
tag = new HtmlTag( 'div', { 'width': 10})

Methods


.new(name, publicId, options)

Convenience constructor Creates a new instance of an HTML (DOM) tag

Parameters:
Name Type Argument Description
name String

the name of the tag

publicId String <optional>
options Object
Returns: HtmlTag
Type
HtmlTag
Example
tag = HtmlTag.new( 'div', { 'width': 10})

#toAttribute(key, value)

Represent the given key and value as an HTML attribute.

Parameters:
Name Type Description
key String

attribute name

value * | boolean

the value of the attribute. If the value is boolean true, return the key only.

Returns: String

the attribute

Type
String