Construct 3 icon

Construct 3

Documentation

DOMInstance script interface

Ashley's avatar
Medal
Construct Team Founder
Published 12 Aug, 2019
108 words
<1 min

The IDOMInstance script interface represents a single instance of an object type (represented by IObjectClass) that appears in a layout and represents a DOM element such as a button or other form control at runtime. It derives from the IWorldInstance script interface.

Note these methods can still be used in worker mode, since it does not directly access a DOM element.

DOMInstance APIs

focus()

blur()

Focus or blur the DOM element represented by this instance.

setCssStyle(prop, val)

Apply a CSS style to the DOM element, using a string of the property name (in CSS format, e.g. "background-color" and a string of the property value (e.g. "red").