removeBehavior Method

DHTML, HTML, & CSS

removeBehavior Method


Detaches a behaviorInternet Link from the element.

Syntax

bSuccess = object.removeBehavior(iID)

Parameters

iID Required. Integer that specifies the identifier returned from a previous addBehavior call.

Return Value

Boolean. Returns true if the behavior was removed successfully, or false otherwise.

Example

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.

Sample Code

<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.
:
This feature requires Microsoft® Internet Explorer 5 or later. Click the icon below to install the latest version. Then reload this page to view the sample.
Microsoft Internet Explorer

Applies To

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
Version data is listed when the mouse hovers over a link, or the link has focus.
A, ACRONYM, ADDRESS, APPLET, AREA, 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, FONT, FORM, FRAME, FRAMESET, HEAD, 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, MARQUEE, MENU, NEXTID, NOBR, NOFRAMES, NOSCRIPT, OBJECT, OL, OPTION, P, PLAINTEXT, PRE, Q, RT, RUBY, S, SAMP, SCRIPT, SELECT, SMALL, SPAN, STRIKE, STRONG, STYLE, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TITLE, TR, TT, U, UL, VAR, WBR, XML, XMP

See Also

addBehavior, dhtml behaviorsInternet Link, using dhtml behaviorsInternet Link, implementing dhtml behaviors in scriptInternet Link


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.