How to show name/value pairs of cookies in a document with JavaScript?

HTMLJavascriptProgramming Scripts

To show the name/value pair of cookies, use the cookie property. You can try to run the following code to display name/ value pairs of cookies in a document with JavaScript −

<!DOCTYPE html>
<html>
   <body>
      <script>
         var val = document.cookie;
         document.write("<br>Name/ Value pair of Cookies: "+val);
      </script>
   </body>
</html>
raja
Published on 26-Feb-2018 12:34:37
Advertisements