We are accustomed to using cookies when we encounter refreshes to preserve the contents of the form, but it is very troublesome to do so, and the behavior in CSS is a good solution to the problem.
Like what:
The top one is the behavior function that is often used, and there are many other functions.
The grammar of Behavior is
Grammar:
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 attached to the same element conflict, the result is determined by the order in which the behavior is applied to the elements. The precedence of the latter behavior is higher than the previous behavior. For example, if multiple behaviors are used to set the object color, the result will be determined by the last action applied to the element. 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
把鼠标放在这里
Behave.htc
handler="hig_lite" />
handler="low_lite" />