Professional Documents
Culture Documents
User is
prompted to enter the input user name and password and password become value of the cookies. Write
the javascript function for storing the cookies.
<html>
<head>
<script>
function storeCookie()
{
var pwd = document.getElementById('pwd').value
document.cookie = "Password=" + pwd + ";"
alert("Cookie Stored " + document.cookie)
}
</script>
</head>
<body>
<form name="myForm">
Enter Username <input type="text" id="uname"/><br/>
Enter Password <input type="password" id="pwd"/><br/>
<input type="button" value="Submit" onclick="storeCookie()"/>
</form>
</body>
</html>