:: Home >>

setStyle

Sets the value of the CSS style attribute.

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

9 May 08
setStyle and CSS calc Oddbj°rn (6)
2 Jul 07
oncellvalidated and background color Michael L (6)
12 Dec 06
Changing font in input Franšois DROUHIN (1)

Comments will appear on this page and in the main forum.

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