test

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<p>
信息记录:<input type="text" id="msg" value="" />
<input type="button" value="记住当前信息" id="sure" />

</p>
<script src="js/jQuery.1.8.3.min.js" type="text/javascript"></script>
<script src="js/jquery.cookie.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
if ($.cookie("username")) {
$("#msg").val($.cookie("username"));
}
$("#sure").click(function () {
$.cookie("username", $("#msg").val());
});
});


</script>
</body>
</html>
posted @ 2017-08-15 23:00  shenq2014  阅读(95)  评论(0编辑  收藏  举报