Syntax for behavior:
Behavior:url (URL) | URL (#objID) | URL (#default #behaviorname)
Take value:
URL (URL): Specifies the DHTML behavior component (. htc) using an absolute or relative URL address.
URL (#objID): The behavior of using binary implementations (as ActiveX® controls). The #objID here is the id attribute value of the object
URL (#default #behaviorname): The default behavior of IE. specified by the name Identification (#behaviorName) of the behavior
Description: Sets or retrieves the DHTML behavior of an object. Multiple behaviors are separated by spaces.
When multiple behaviors that are attached to the same element collide, the result depends on the order in which the behavior is applied to the elements. The precedence of the latter behavior is higher than the previous behavior. The same rule applies to the name conflicts that occur for properties, events, and methods that are provided by different behaviors.
You can use the Addbehavior method to dynamically attach behavior to an object.
This property is read-only for Currentstyle objects. is writable for other objects.
It is important to note that using the Behavior property of the style sheet (CSS) to inline definitions or to use the Addbehavior method to attach the behavior is automatically detached when the object is removed from the document tree. The behavior defined by a style sheet rule in a document is automatically detached when the object is removed from the document tree.
The corresponding script attribute is behavior.
Example:
P {behavior:url (#default #download);}
div {behavior:url (fly.htc) URL (shy.htc);}
div {behavior:url (#myObject);}
Application 1: Refresh also retains the text in the input box
. shistory {}{behavior:url (#default #savehistory);}
Application 2: Calling the script
<style>
H1 {Behavior:url (BEHAVE.HTC)}
</style>
<body>
</body>
Behave.htc
<component>
<attach for= "element" event= "onmouseover" handler= "Hig_lite"/>
<attach for= "element" event= "onmouseout" handler= "Low_lite"/>
<script type= "Text/javascript" >
function Hig_lite ()
{
lor=255
}
function Low_lite ()
{
Lor=0
}
</script>
</component>
Note: CSS when try to avoid the use of behaviors technology
Internet Explorer Behaviors
What is it? Internet Explorer 5 introduces behavior (behaviors). Behaviors is a way to add behavior to HTML elements by using CSS.