Ask Learn
Preview
Please sign in to use this experience.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Detaches a behavior from the element.
*object.*removeBehavior(cookie)
cookie [in]
Type: Integer
Value that specifies the identifier that is returned from a previous addBehavior call.
Type: Boolean
Returns one of the following possible values.
Return value | Description |
---|---|
true | The behavior was successfully removed. |
false | The behavior was not removed. |
There are no standards that apply here.
This method applies only to attached behaviors, which are the original Dynamic HTML (DHTML) behaviors introduced in Microsoft Internet Explorer 5. Element behaviors are a feature in Microsoft Internet Explorer 5.5 and cannot be added or removed from an element.
This example uses the removeBehavior method to show how a behavior that implements a mouseover highlighting effect can be dynamically removed from all li elements on a page.
Code example: http://samples.msdn.microsoft.com/workshop/samples/components/htc/refs/addBehavior.htm
<script type="text/javascript">
var collBehaviorID = new Array();
var collLI = new Array ();
var countLI = 0;
:
function detachBehavior()
{
for (i=0; i < countLI; i++)
collLI[i].removeBehavior (collBehaviorID [i]);
}
</script>
:
Click <a href="javascript:detachBehavior()">here</a>
to remove highlighting effect.
:
Reference
Conceptual
Introduction to DHTML Behaviors
Using HTML Components to Implement DHTML Behaviors in Script
Please sign in to use this experience.
Sign in