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

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -