<script>
var a=document.getElementsByName("c1")
for(var i=0;i<a.length;i++)
{
  if(a[i].checked){alert(a[i].value)}
}
if()
<script>
<input type="checkbox" name="c1" value="1">
<input type="checkbox" name="c1" value="2">
<input type="checkbox" name="c1" value="3">
<input type="checkbox" name="c1" value="4">