ElementData

Methods

# (inner) attr(?attribute, ?value) → {jLight|Object.<string, string>|boolean}

Sets an attribute or attributes to the collections elements or gets its value or values.
Parameters:
Name Type Attributes Description
attribute string | Object.<string, *> <optional>
The attribute or attributes to set or get
value * <optional>
The value to set the attribute to
Source:
Tutorials:
Returns:
jLight collection, the attributes value, an object of each attribute on the collections elements or if the attribute whether present on at least one of the collections elements
Type
jLight | Object.<string, string> | boolean

# (inner) data(?keyOrData, ?value) → {jLight|*}

Gets or sets the jLight data of the collections elements.
Parameters:
Name Type Attributes Description
keyOrData string | Object.<string, *> <optional>
The key of the data value to get or set or an object of data values to set.
value string | Array.<string> <optional>
The value to set the data at the supplied key to.
Source:
Tutorials:
Returns:
jLight collection
Type
jLight | *

# (inner) html(?html) → {jLight|string}

Gets or sets the HTML content of the collections elements.
Parameters:
Name Type Attributes Description
html string <optional>
The html to supply to the function
Source:
Tutorials:
Returns:
jLight collection or the html content
Type
jLight | string

# (inner) prop(property, ?state) → {jLight|boolean}

Sets a property of the collections elements or gets its value.
Parameters:
Name Type Attributes Description
property string The property to set or get
state boolean <optional>
The state to set the property to
Source:
Tutorials:
Returns:
jLight collection or if the property is set on at least one of the collections elements
Type
jLight | boolean

# (inner) removeAttr(attribute) → {jLight}

Removes the supplied attributes from the collections elements.
Parameters:
Name Type Description
attribute string | Array.<string> The attribute or attributes to remove
Source:
Tutorials:
Returns:
jLight collection
Type
jLight

# (inner) text(?text) → {jLight|string}

Gets or sets the text content of the collections elements.
Parameters:
Name Type Attributes Description
text string <optional>
The text to supply to the function
Source:
Tutorials:
Returns:
jLight collection or the text content
Type
jLight | string

# (inner) val(?valueOrFunction) → {jLight|boolean|string}

Gets or sets the collections elements values.
Parameters:
Name Type Attributes Description
valueOrFunction boolean | null | string | Array.<boolean> | function | iteratorCallback <optional>
The value to set the collections elements value to. If a function is supplied its return value will be set as the value. If the jLight element is an HTMLSelectElement with the multiple attribute each option will be passed separately to the function. In that case an array of booleans can be used to set the selected options.
Source:
Tutorials:
Returns:
jLight collection or the value
Type
jLight | boolean | string