Hello experts, I want to store the values of my checkboxes into cookies when checked. here is my code: function keepID(value) { i = 0; var ca = document.cookie.split(';'); for(i=0;i<<?php echo $_SESSION['row'] ?>;i++) { if(document.myform.chkID.checked==true) { ca=value; } } } My checkboxes are moving in a loop: <input type="checkbox" name="chkID[]" id="chkID" value="<?=$rowSubjects['ID']?>" onClick="keepID(<?=$rowSubjects['ID']?>)"> Please help....