:: Documentation >>

setStyle

Sets the value of the CSS style attribute.

null

Syntax

obj.setStyle(name, value);

Parameters

name (string) - style name
value (string or function) - style value

Example

obj.setStyle("border", "2px solid red");

Remarks

The value parameter can be a function, which will be called each time the html is generated (in toString() or refresh() methods), for example

obj.setStyle("color", function(){
    return this.getControlProperty("color");
});

See also

getStyle() method

Known bugs

If the style name contains "-" it will not be immediately updated on screen

Comments

setStyle and CSS calc Oddbjørn (6)
oncellvalidated and background color Michael L (6)
Changing font in input François DROUHIN (1)

Documentation:

Recent changes:

2.6.4
2.6.3
2.6.2
2.6.1
2.6.1
2.6.0
2.5.0 - 2.5.6
2.5.6
2.5.0 - 2.5.5
2.5.5