programmatically add class name to fields I want to add custom class name to fields in user login form other than default class name.
For example,


user-name-field for Username field
password-field for Password field
click-me-button for Submit button
creat-account-link for Create new account
request-password for Request new password


how to do this programmatically?
Alter the login form using hook_form_alter(). And use #attributes to add custom classes to fields.