If you have an input element in a form with the same name as a form's native property, then that element will shadow the native property.

For example, consider the following form:

<form id = "test"> <input name="tagName" type="text" /> <input name="nodeName" type="text" /> </form>

The form element's tagName and nodeName both normally return FORM . But in this case, the following code:

var f = document.getElementById("test"); console.log(f.tagName); console.log(f.nodeName); console.log(f["tagName"]); console.log(f["nodeName"]);

displays:

<input name=​"tagName" type=​"text">​ <input name=​"nodeName" type=​"text">​ <input name=​"tagName" type=​"text">​ <input name=​"nodeName" type=​"text">​

Is there a workaround for this (other than renaming the fields)? getAttribute works for things like name , action , or method , but not for properties like nodeName or tagName .

Fiddle here.