- <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.1.min.js"></script>
- <script src="js-cookie-master/src/js.cookie.js"></script>
- <script>
- $(function () {
- $("button").click(function () {
- alert("You clicked Submit button");
- var uid = $("#username").val();
- var pwd = $("#password").val();
- $.cookie("username", uid);
- $.cookie("password", pwd);
- alert("username =" + uid + "password = " + pwd);
- });
- });
- </script>
Here's my js to create cookie using jQuery. But it is not working. Why?