»
EnglishFrenchVietnamese

Print - Keep record of time - JavaScriptBank.com

Full version: jsB@nk » Form » Checkbox » Keep record of time
URL: https://www.javascriptbank.com/keep-record-of-time.html

Keep record of time © JavaScriptBank.comThis JavaScript keeps record of the time the checkboxes are checked and unchecked.

Full version: jsB@nk » Form » Checkbox » Keep record of time
URL: https://www.javascriptbank.com/keep-record-of-time.html



JavaScript
<SCRIPT language=Javascript>ClickOn=new Array(0,0,0)function Chk(x){Now=new Date()Time=Now.toString().split(" ")DateStr=Time[0]+" "+Time[1]+" "+Time[2]+" "+Time[3]ClickOn[x]=!ClickOn[x]if(ClickOn[x]) IsChecked(x)else NotChecked(x)}function IsChecked(x){document.forms[0].TextArea.value+=DateStr+": "+document.forms[0].check[x].value+" is checked\n"}function NotChecked(x){document.forms[0].TextArea.value+=DateStr+": "+document.forms[0].check[x].value+" is unchecked\n"}</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<FORM><INPUT onclick=Chk(0) type=checkbox value=Car name=check> Car<BR><INPUT onclick=Chk(1) type=checkbox value=House name=check> House<BR><INPUT onclick=Chk(2) type=checkbox value=Boat name=check> Boat<BR><HR>This script keeps record of the time the checkboxes are checked and unchecked.<BR><BR><TEXTAREA name=TextArea rows=10 cols=40></TEXTAREA> </FORM><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->