Question: Im trying to get some checkbox with a specific name 

```
document.getElementsByName("test");

```

Unfortunatley i cant check if it is checked or not here is the code

```
for(i=0;i<check.length;i++)
        {
            if(check[i].checked==true)
            {
                alert(check[i].value);
            }
        }

```

Is somewhere a typo?

Answer: 
> 
> Use the following code
> 
> 
> 

```
<html>
<script type="text/javascript">
function test()
{

if(document.getElementById("chk").checked)
{

  alert('Checked');
}
}
</script>
<body>
<input type="checkbox" id="chk">
<input type="button" onclick="test();"></input>
</input>
</body>
</html>

```
```
for(i=0;i<check.length;i++)
        {
            if(check[i].checked==1)
            {
                alert(check[i].value);
            }
        }

```

Try this ?

@streetparade : tell me if this is also not working .... so that i can delete my answer... people didn't like it