Form control names are used to create named properties of the form that reference the control. So where you have:
<form id="test">
<input name="id">
</form>
then the form's id property is assigned a reference to the input element named id. Form controls should never be given names that are the same as standard form properties, e.g. in the following:
<form>
<input name="submit">
</form>
it is impossible to call the form's submit method because form.submit references the input, not the method.
As noted in other answers, you can either change the name to something that doesn't clash with standard form properties, or use getAttribute. The first solution is preferred as it will also likely lead to more suitable names for the form controls and avoid the use of getAttribute.