Detaches a behavior from the element.
Syntax
object.removeBehavior(cookie)Standards information
There are no standards that apply here.
Parameters
- cookie [in]
-
Type: long
Value that specifies the identifier that is returned from a previous addBehavior call.
Return value
Type: BooleanReturns one of the following possible values.| Return value | Description |
|---|---|
|
The behavior was successfully removed. |
|
The behavior was not removed. |
Remarks
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.
Examples
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 LANGUAGE="JScript">
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.
:
See also
- a
- abbr
- acronym
- address
- applet
- area
- article
- aside
- b
- base
- baseFont
- bgSound
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- col
- colGroup
- comment
- custom
- dd
- del
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- figcaption
- figure
- font
- footer
- form
- frame
- frameSet
- head
- header
- hgroup
- hn
- hr
- html
- 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
- isIndex
- kbd
- label
- legend
- li
- link
- listing
- map
- mark
- marquee
- menu
- nav
- nextID
- noBR
- noFrames
- noScript
- object
- ol
- option
- p
- plainText
- pre
- q
- rt
- ruby
- s
- samp
- script
- section
- select
- small
- span
- strike
- strong
- style
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- title
- tr
- tt
- u
- ul
- var
- wbr
- xml
- xmp
- Reference
- addBehavior
- Conceptual
- Introduction to DHTML Behaviors
- Using DHTML Behaviors
- About Element Behaviors
- Using HTML Components to Implement DHTML Behaviors in Script
Send comments about this topic to Microsoft
Build date: 3/14/2012