If no match was found using id, look for a sibling of the label with a class matching the label's for attribute, and focus it. The htmlFor property sets or returns the value of the for attribute of a label. Definition and Usage. The step attribute works with the following input types: number, range, date, datetime-local, month, time and week. Code snippet: HTML With a text input (and you'll have to check this to be sure) I think it only gives focus to the input when the user clicks the label. A label, or caption, for a form control.. A label can be associated to a form control either by nesting the control within it or by matching the value of the label’s for attribute to the value of a control’s id attribute. The label of a