How to add custom class to a  fileds on the renderable array of user_profile_form I have a requirement to add a class to  ul  li  on the user_profile_form edit page on admin side. 
Using Hierarchical Select Taxonomy module regions are listed on this form.The purpose is to modify  the listing of the regions by adding different classes for the regions based on the taxonamy id.
You can do it 2 ways. One is to modify the element attributes, like this:

$form['textfield'] = [
  '#type' =&gt; 'textfield',
  '#attributes' =&gt; [
    'class' =&gt; [
      'ul',
    ]
  ],
];


Or, another way, wrap the elements with '#prefix' and '#suffix'.

$form['textfield'] = [
  '#type' =&gt; 'textfield',
  '#prefix' =&gt; '&lt;div class="ul"&gt;',
  '#suffix' =&gt; '&lt;/div&gt;',
];


I would use the first preferably when I can.