Google News
logo
JavaScript - Interview Questions
How to create a Cookie using JavaScript ?
The simplest way to create a cookie is to assign a string value to the document.cookie object, which looks like this  :

Syntax  :  document.cookie = "key1 = value1; key2 = value2; expires = date";
Advertisement