IHTMLElement2::removeExpression method
This element is obsolete and should no longer be used. Removes the expression from the specified property.
Syntax
Boolean* removeExpression(
[in] String sPropertyName
);
Parameters
- sPropertyName [in]
-
String that specifies the name of the property from which to remove an expression.
Return value
C++
| Return value | Description |
|---|---|
|
The expression was successfully removed. |
|
The expression was not removed. |
JavaScript
Returns one of the following possible values:| Return value | Description |
|---|---|
|
The expression was successfully removed. |
|
The expression was not removed. |
Remarks
After the expression is removed from the specified property, the value of the property equals the last computed value of the expression. To remove expressions set by the setExpression method, use removeExpression.
The following syntax sections show how to remove an expression from supported Cascading Style Sheets (CSS) attributes and DHTML Properties.
- Use this syntax to remove an expression from a read/write property or from an expando property.
object.removeExpression(sPropertyName)
- Use this syntax to remove an expression from a CSS attribute.
object.style.removeExpression(sPropertyName)
Examples
This example uses the removeExpression method to remove an expression from the width property of a blue box.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/removeExpression.htm
<INPUT TYPE=text ID=oBox1 value=40>The sum of the values in these two text boxes determines the width <BR><INPUT TYPE=text ID=oBox2 value=40>of the blue text box below.
<BR><INPUT TYPE=text ID=oBox3 STYLE="background-color:blue">
<BR><BR><INPUT TYPE=button ID=Button1
value="Step 1: Get expression" onclick="getexp()">
<INPUT TYPE=button ID=Button2 value="Step 2: Remove expression"
onclick="remexp()">
<INPUT TYPE=button ID=Button3 value="Step 3: Get expression again"
onclick="getexp()">
<BR>
<HR>
<BR>
Right-click anywhere on this page to view the source code.
<SCRIPT>
var s;
var b;
oBox3.style.setExpression("width","eval(oBox1.value) +
eval(oBox2.value)","jscript");
function getexp()
{
s=oBox3.style.getExpression("width");
alert("Expression for the width of the blue box is \n\n" + s +
"\n\nThe width property has a value of " + oBox3.style.width);
}
function remexp()
{
b = oBox3.style.removeExpression("width");
alert("Expression removed successfully? \n" + b);
}
</SCRIPT>
See also
- IHTMLElement2
- IHTMLStyle2
- runtimeStyle
- style
- Reference
- getExpression
- recalc
- Conceptual
- About Dynamic Properties
Send comments about this topic to Microsoft
Build date: 11/29/2012