<html> <head> <script> function deleteCookie() { var username = document.getElementById("username").value; document.cookie = "username=" + username + ";expires=Thu, 01 Jan 1970 00:00:01 GMT"; alert("Cookie is deleted " + username ); } </script> </head> <body> Enter Username:<input type="text" id='username'> <input type="button" value='Delete Cookie' onclick='deleteCookie()'> </body> </html>