asp.net.ph

Skip Navigation Links

removeExpression Method

DHTML Methods


DOM Level 2 Specification.

Removes an expression from the given CSS property.

Syntax

bSuccess = object.removeExpression ( sPropertyName ) 
Parameters

sPropertyName Required. Name of the property from which to remove an expression.

Return Value

Boolean. Returns true if the expression was successfully removed, or false if it was not successfully removed.

Remarks

This method deletes a CSS property if it has been explicitly set within the declaration block.

The value of the property after the expression has been removed is equal to the last computed value of the expression. Expressions set by the setExpression method can be removed only by invoking removeExpression.

The removeExpression method applies to the style subobject and can be used to remove expressions from supported CSS Attributes. This method is also available in scripting for the innerHTML and value attributes.

Using removeExpression in script:

object.removeExpression ( sProperty, sExpression, 
   sLanguage ) 

Using removeExpression on a style:

object.style.removeExpression ( sProperty, sExpression, 
   sLanguage ) 

This method is Microsoft's® implementation of the generic removeProperty interface provided for in the DOM.

Example

The following sample code illustrates the implementation of removeExpression. The blue box's width is defined as an expression equal to the sum of the two values in the first two text boxes. The first button brings up an alert box revealing the expression for the width of the blue box. The second button removes the expression. The third button brings up another alert box revealing the expression for the width of the blue box. However, the blue box no longer has an expression for its width, so getExpression returns undefined. Note that after the expression is removed, the value for the blue box's width property remains equal to the last calculated value of the expression.

Sample Code


See Also

Dynamic Properties, getExpression, recalc, setExpression



© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note