插件下载链接:http://plugins.jquery.com/cookie/
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>基于jquery的cookie插件</title>
<script src="scripts/jquery-1.7.1.min.js"></script> <!--先引入jquery-->
<script src="scripts/jquery.cookie.js"></script> <!--再引入cookie插件-->
<script>
$(function () {
//设置Cookie按钮
$('#btnSet').click(function(){
var date = new Date();
$.cookie('myDate',date.toLocaleString()); //设置Cookie(键值对)
});
//获取Cookie按钮
$('#btnGet').click(function(){
$('#textTime').val($.cookie('myDa