The name and id of the form actually have the same meaning, both for marking the object name.
The difference is that name is Netscape and id is Microsoft.
The form input textarea select and the frame element (iframe frame) use name.
These elements are related to form (frame elements acting on form target) submissions.
Only elements with name are received on the form's receiving page.
The element assigned with ID cannot receive the value through the form, so you can verify it yourself.
Of course, the above elements can also be assigned ID values. The method of referring these elements when assigning ID values will change.
Name: document.formName.inputName document.frames("frameName")
Assign ID: document.all.inputID document.all.frameID
Elements that can only be assigned ID but cannot be assigned name: (Except for elements related to form, only ID can be assigned)
body li a table tr td th p div span pre dl dt dd font b etc