Element.setExpression() (Method)

Part of the behavior handling mechanisms in MSIE.

Availability:

JScript - 5.0
Internet Explorer - 5.0
JavaScript syntax:IEmyElement.setExpression(aProperty, anExpression, aLanguage)
Argument list:aPropertyThe name of a property to be modified
anExpressionAn expression to assign
aLanguageThe language the expression is defined in

The rules that are used to construct a style are comprised of multiple expressions. You can use this method to assign a new value to an expression within a style item with that value being generated by a callback to a script function.

The rule might contain a line such as:

width:200px

The setExpression() method can be applied to the style object containing the rule with that expression like this:

myStyle.setExpression("width:", "callBack()", "JavaScript")

The value of the width parameter would be defined by the result of calling the callBack() function in the JavaScript context.

The language argument can be one of the following:

See also:Element.getExpression(), Element.removeExpression(), style.getExpression(), style.removeExpression(), style.setExpression()