document.getElementsByName

document.getElementsByName("test");
 
We can get the Element Object by using the above method.
But we should not use this method on any dynamic elements like 
 
1. Radio Buttons
2. Check Boxes
 
etc..
 
If test is a name of Checkbox.
 
document.getElementsByName("test").checked will give 'undefined' output.

Use,

document.getElementById("test").checked will give true or false.