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