<script language= "JavaScript" > Function Setcookie (name, value) {//Set name, the value of the cookie Document.cookie = name + "=" + value document.location.reload (); function Setcookie () {document.cookie= "A=ABCD;" Document.cookie= "b=5678;" Document.location.reload (); var mycookie = Document.cookie; function Readcookie (name) {var start1 = Mycookie.indexof (name + "="); if (start1==-1) alert ("Cookies not Found"); else {start=mycookie.indexof ("=", Start1) +1; var end = Mycookie.indexof (";", start); if (end==-1) {end=mycookie.length;} var value=unescape (mycookie.substring (start,end)); if (value==null) {alert ("No cookie found!");} else {alert ("Cookie variable: +name+" value is: "+value);}}} </script> <input type= "button" onclick= "Setcookie ()" value= "set a=abcd;b=5678" > <input type= "button" onclick= "Setcookie (' a ', ' QQ ')" value= "set A=QQ" > <input type= "button" onclick= "Readcookie (' a ');" VAlue= "read a" > <input type= "button" onclick= "Readcookie (' B ');" value= read B ">
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]