Retrieves the expression for the given property.
Syntax
vExpression = object.getExpression(sPropertyName)
Parameters
sPropertyName Required. String that specifies the name of the property from which to retrieve the expression.
Return Value
Variant. Returns a variant value representing the expression of the property.
Remarks
The following syntax sections show how to retrieve an expression from supported cascading style sheets (CSS) attributes and Dynamic HTML (DHTML) properties.
- Use this syntax to retrieve an expression from a read/write property or from an expando property.
var sExpression = object.getExpression(sPropertyName)- Use this syntax to retrieve an expression from a CSS attribute.
var sExpression = object.style.getExpression(sPropertyName)
Example
This example uses the getExpression method to set the width of a paragraph equal to the sum of the width of two images. The getExpression method returns a variant containing the expression.
Sample Code
<P ID=para1 STYLE="width:expression(Img1.width + Img2.width); back-color:blue" onclick="getexp()">Click here to see the expression.</P> <SCRIPT> var s; function getexp() { s=para1.style.getExpression("width"); alert("Expression for the width of the paragraph is \n\n" + s + "\n\nThe width property has a value of " + oBox3.style.width); } </SCRIPT>
Applies To
A, ACRONYM, ADDRESS, AREA, B, BDO, BIG, BLOCKQUOTE, BODY, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, custom, DD, DEL, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FONT, FORM, Hn, HR, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, INS, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, NOBR, OBJECT, OL, OPTION, P, PRE, Q, RT, RUBY, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, style, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR
See Also