This code makes no sense.
The name of an <input> field is simply a string.
So when you do
that gives you a string.
You can *NOT* then get the .value
attribute of a string. Strings don't have a .value
On top of that, the name of an <input> field is determined by the HTML coder. As in:
<input type="text" id="zamboni" name="widget" />
So the person *using* the HTML page has NO CONTROL WHATSOEVER over that name. It is and will be whatever the person who coded the HTML assigned it to be.
I think you are very very badly confused.