Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Sets an expression for an element object.
Syntax
HRESULT setExpression( BSTR sPropertyName, BSTR sExpression, BSTR sLanguage );
Parameters
- sPropertyName
- Required. Name of the attribute to which sExpression will be added.
- sExpression
- Required. Any legal script. This string may include references to other properties on the current page. Array references are not allowed on object properties included in this script.
- sLanguage
- Required. This can be one of the following values:
JScript Specifies the language as JScript (compatible with ECMA 262 language specification). VBScript Specifies the language as VBScript. JavaScript Specifies the language as JavaScript.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
To remove an expression and replace the property value with the "system default" value, use the form elem.style.removeExpression("color").
To remove an expression and replace the value with a static value, use elem.style.removeExpression("color") followed by elem.style.color = "red".
To remove an expression and replace it with the current value (recalculated value) use temp = elem.style.color, next use elem.style.removeExpression("color"), and then elem.style.color = temp.
See Also
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.