HTML:
<input type="button" value="清空cookie" onclick="delCookie();"/>
JAVASCRIPT:
function delCookie () { var keys = document.cookie.match(/[^ =;]+(?==)/g) if (keys) { for (var i = keys.length; i--;) { document.cookie = keys[i] + '=0;path=/;expires=' + new Date(0).toUTCString() // 清除当前域名下的 document.cookie = keys[i] + '=0;path=/;domain=' + document.domain + ';expires=' + new Date(0).toUTCString() // 清除当前域名下的 document.cookie = keys[i] + '=0;path=/;domain=afxzyw.cn;expires=' + new Date(0).toUTCString() // 清除一级域名下的或指定的 } } }
QQ群:513185891