Old Geezer Old Geezer - 9 months ago 55
Javascript Question

Unable to get the NAME property from the DOM

I am unable to get the

attribute directly as a property of a DOM object.

As seen from a screenshot of Chrome Developer Tools, there is no property called
for a typical

enter image description here

Am I missing something basic?

Answer Source

You can use element.getAttribute('name') and it will return value of name attribute from any elements.