Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <script src="http://code.jquery.com/jquery-1.11.1.js"></script>
- <script src="JS/jquery.cookie.js"></script>
- <body>
- Name:
- <input type="text" id="nInput">
- <button id="nBtn">Submit</button>
- <button id="rBtn">Read</button>
- <script>
- $("#nBtn").click(function (event) {
- $.cookie("name", $("#nInput").val(), {
- expires: 7,
- path: '/'
- });
- alert($("#nInput").val());
- //alert("submit");
- });
- $("#rBtn").click(function (event) {
- alert($.cookie("name"));
- //alert("read");
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement