:: Home >>

setAttribute

Sets the value of the html attribute.

Syntax

obj.setAttribute(name, value);

Parameters

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

Example

obj.setAttribute("title", "some text");

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.setAttribute("value", function(){
    return this.getControlProperty("value");
});

See also

getAttribute() method

Comments

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

Documentation:

Recent changes:

2.5.0 - 2.5.3
2.5.3
2.5.0 - 2.5.2
2.5.2
2.5, 2.5.1
2.5.1
2.5
Release History
2.5
2.0.2