HTML DOM cookie 屬性
定義和用法
cookie 屬性可設(shè)置或查詢與當(dāng)前文檔相關(guān)的所有 cookie。
語(yǔ)法
document.cookie
說(shuō)明
該屬性是一個(gè)可讀可寫(xiě)的字符串,可使用該屬性對(duì)當(dāng)前文檔的 cookie 進(jìn)行讀取、創(chuàng)建、修改和刪除操作。
提示和注釋
提示:該屬性的行為與普通的讀/寫(xiě)屬性是不同的。
實(shí)例
<html> <body> The cookies associated with this document is: <script type="text/javascript"> document.write(document.cookie) </script> </body> </html>