No, I mean that the element's name attribute should not be used as the id. Use explicit id values. As in:
Relying upon the name being assigned as the id is a holdover from older browsers that still exists for backwards compatibility but could become unsupported at any time. It's best to break that habit and be explicit.
I only used that because it's flexible and can be applied to many text fields at once instead of having to explicitly use hard coded values which may change later on.
I don't really see the advantage of creating a function to replace a single line of code unless it has clear readability advantages, which in this case, I do not feel apply. The hard-coded value of the id still needs to be used in the code whether a user-supplied function or the document method is used or not.