0 votes
in JavaScript by
How can you create a cookie with the help of JavaScript?

1 Answer

0 votes
by

You can create a cookie in JavaScript simply by assigning a string value to the document.cookie object. 

The syntax:

document.cookie = “key1 = value1; key2 = value2; expires = date”;

Related questions

0 votes
asked Oct 19, 2019 in JavaScript by SakshiSharma
0 votes
asked Oct 21, 2023 in JavaScript by DavidAnderson
...