Click to return to the DHTML, HTML     
getElementsByTagName Meth...     go Method     DHTML Methods    
Web Workshop  |  DHTML, HTML & CSS

getExpression Method


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.

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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
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

Dynamic Properties, recalc, removeExpression, setExpression



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.