zoukankan      html  css  js  c++  java
  • HTML小技巧:页面刷新后表单中值不丢失[经典]

    代码示例:

    <html>
    <head>
    <title>saveHistory行为应用</title>
    <meta name="save" content="history">
    </head>
    <body>
    用了saveHistory 行为的表单项:<br>
    <INPUT style="behavior:url(#default#savehistory)"><br>
    一般表单项:<br>
    <input>
    </body>
    </html>

     注意:<meta name="save" content="history"> 这行代码为必需。

    特别说明

    saveHistory 默认行为允许对象在浏览器历史中留存数据,相关的特性、事件和方法说明如下:
    特性: 
    XMLDocument 对对象提供的 XML DOM 的引用。

    事件:
    onload 页面重载时在持久对象上触发。
    onsave 在保存、设置 Web 页为标签或离开该页时从持久对象上触发。

    方法:
    getAttribute 获取指定属性的值。
    removeAttribute 从对象移除指定属性。
    setAttribute 设置指定属性的值。

    要了解更多关于IE默认行为的资料,可以访问MSDN:
    http://msdn.microsoft.com/workshop/author/behaviors/reference/reference.asp
  • 相关阅读:
    管道流
    构造方法中用泛型
    代码实现长提闪烁
    关联事件,向窗体中添加控件,设置控件属性等系列操作
    picturebox中添加图片
    typeof gettype
    groupbox
    static用法
    运算符重载
    类修饰符
  • 原文地址:https://www.cnblogs.com/Apollo/p/434070.html
Copyright © 2011-2022 走看看