My knowledge on javascript is limited. What I want to do is to pass the value of selected checkbox.
codes below, I got an undefined error.
<html>
<head>
<script language="JavaScript">
<!--
function test()
{alert(document.form1.a.value);}
//-->
</script>
</head>
<body>
<form method=post action="" name="form1" id="form1">
<input type="checkbox" name="a" value=1>
<input type="checkbox" name="a" value=2>
<input type="checkbox" name="a" value=3>
<input type="button" onclick="test();">
</form>
</body>
</html>
Thanks in advance.
edit: highlighted codes in question.