javascript - JQuery set cookies -
how save div title cookies? , how saved data, back?
<script type="text/javascript"> function setcookie(title, value, exp) {     var expdate = new date();     expdate.setdate(expdate.getdate() + exp);     document.cookie = title+'='+value+';expires='+expdate.togmtstring()+';path=/'; } </script>  <div title="1" onclick="setcookie();"></div>      
see this question jquery , cookies. easier use plug-in, http://plugins.jquery.com/project/cookie.
use following code title of div:
title = $("div").attr("title");      
Comments
Post a Comment