Element
A property of type KontrastElement
is used to assign HTML
elements within the current HTML page to figures and sliders.
Assignment
-
You can assign a HTML element directly (for example, by calling
getElementById('elementName')
). -
You can also assign a string. In this case, the HTML element with the requested ID attribute is used. An error is thrown in case the element does not exist.
Interface
Functions
-
assign(value: HTMLElement | string)
Assign a new element. Ifvalue
is a string, the HTML element with the corresponding ID is looked up automatically. -
addEventListener(eventName: string, callback: function)
Registers the callback function as an event listener for the specified event name. -
clearEventListener(eventName: string)
Remove all event listener callbacks associated with the event name.
Properties
-
type
:string
The read-only string 'KontrastElement'.
-
value
:HTMLElement
The current value. If the element has not been assigned yet, this returns undefined instead.
Events
-
change
, callback:function () { … }
Event that fires whenever the value is changed.