Joke Collection Website - Public benefit messages - How to use js to put the randomly obtained verification code into the cookie?

How to use js to put the randomly obtained verification code into the cookie?

If you use the jquery cookie plug-in, just $ Cookies ("cookie name", "verification code value"); Do it.

If it is a native JS, document.cookie = "cookies =" cookie name = "+verification code value;