setSimpleElementStyle

public static setSimpleElementStyle(
    element: Jquery<Element> | readonly Element[] | NodeListOf<Element> | HTMLCollectionOf<Element> | Element | undefined,
    property: string,
    value: string | null | undefined
): void;

Sets a CSS property for one or more HTML or SVG elements.

Parameter

Name

Type

Description

element

Info: Type Element supported from version 1.10
Info: Types Element[] | NodeListOf<Element> | HTMLCollectionOf<Element> from version 1.10.1171.21

JQuery<Element>, readonly Element[], NodeListOf<Element>, HTMLCollectionOf<Element>, Element, undefined

  • jQuery collection with the elements to be changed
  • any array-like element list (also for example from document.querySelectorAll() or document.getElementsByClassName())
  • individual element, for example HTML or SVG element.

property

string

Name of the CSS property

value

string, null, undefined

Desired new value of the CSS property. The value null (not the string "null") or undefined deletes the current value.

Return value

Type

Description

void

No return value

setSimpleElementStyle 1:

Available from 1.8

Sample - JavaScript

var control = TcHmi.Controls.get('TcHmiButton');
if(control === undefined){
    return;
}
var cntrlElem = control.getElement();
TcHmi.StyleProvider.setSimpleElementStyle(cntrlElem, 'height', '42px');