Dhtml|xml
One behavior is a CSS property selector. It can point to an XML file that contains the opposite code that is executed against elements in a Web page. Behavior is not a standard for the consortium, it is a technology unique to Microsoft.
What is the behavior?
One behavior is a new CSS property selector. An action selector can point to a separate XML file that contains the opposite code that is executed by XML or HTML elements in a Web page. Do you understand me? Is it a way to completely remove the scripting code from the HTML page? That's great. Now we start by writing a script library and then attach the script to any element we choose.
How does it work?
Look at this HTML file. It has a < style> element that defines an behavior for the < h1> element:
< html>
< head>
< style>
H1 {Behavior:url (BEHAVE.HTC)}
</style>
< body>
< H1>move your Mouse over me</body>
Try this example yourself and move the mouse over the text. The behavior code is stored in the XML document BEHAVE.HTC, as follows:
< component>
< attach for= "element" event= "onmouseover"
handler= "Hig_lite"/>
< attach for= "element" event= "onmouseout"
handler= "Low_lite"/>
< script language= "JavaScript" >
function Hig_lite ()
{
element.style.color=255
}
function Low_lite ()
{
Element.style.color=0
}
</script>
</component>
This behavior file contains JavaScript. This script is wrapped in a < component> element. The element wrapper also contains the event operator for the script. It's a good act, isn't it?