css实现刷新页面的同时保存页面控件的输入值这个对于我们来讲是非常好用了,像有些页面不小心刷新了页面表单值就丢失了需要重新输入非常的麻烦,那么我们可以使用css来定义页面刷新值保存起来,具体设置如下。
在Head中加入<meta name="save" content="history">
添加css: input{behavior:url(#default#savehistory)};
e.g. 页面上存在<input type=text id="txttestsavehistory"/>
给 input输入值后刷新页面看看,输入的值还在
例子
代码如下 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<
html
>
<
head
>
<
meta
http-equiv
=
"Content-Type"
content
=
"text/html; charset=utf-8"
/>
<
meta
name
=
"save"
content
=
"history"
>
<
title
>www.zzarea.com</
title
>
<
mce:style
type
=
"text/css"
>
<!--
input{behavior:url(#default#savehistory)};
-->
</
mce:style
><
style
type
=
"text/css"
mce_bogus
=
"1"
>input{behavior:url(#default#savehistory)};</
style
>
</
head
>
<
body
>
<
DIV
style
=
"float:left"
mce_style
=
"float:left"
>
<
ul
>
<
li
><
label
style
=
"width:100px"
>hhhhh</
label
><
input
type
=
"text"
></
li
>
<
li
><
label
style
=
"width:100px"
>sssssssssss</
label
><
input
type
=
"text"
> </
li
>
</
ul
>
</
DIV
>