This is not a mistake, it is recommended to label the corresponding form element with the UX convenience. For example, the Name field:
Then give an example
<label for= "name" >nazwa:</label><textarea class= "Form-control" id= "name" Name= "NewTodo" Data-ng-model= "Formdata.newtodo" required></textarea>
Make the label's for point to the ID of input, so that when you click the label, input gets the focus.
What about the relationship between name and ID?
ID is like a person's ID number, and name is like his name, the ID is obviously unique, and name can be duplicated.
The following can only be used with name:
1. The control name of the form (form), and the submitted data is controlled by the control's name instead of the ID.
Because there are many name that correspond to multiple controls at the same time, such as checkbox and radio, the ID must be unique in the full-text file. In addition, the browser sets the request sent to the server according to the name. Therefore, if the ID is used, the server cannot get the data.
2. The name of frame and window for assigning target to another frame or window.
The following can only be used with ID:
1. label associated with form control, My InputThe For property specifies the ID of the element associated with the label and is not substituted with name.
2. CSS element selection mechanism,
About HTML name and Id,form input without an associated label or title attribute