Javascript examples for Browser Object Model:Navigator
The cookieEnabled property returns a Boolean value tells whether cookies are enabled in the browser.
A Boolean, indicating whether cookies are enabled in the browser. Returns true if enabled, otherwise it returns false
The following code shows how to check if cookies are enabled in your browser:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {//from w w w. j a v a2s . c om var x = "Cookies enabled: " + navigator.cookieEnabled; document.getElementById("demo").innerHTML = x; } </script> </body> </html>