Adding title attribute to #type password_confirm Is it possible to add a title attribute through a form_alter to element #type 'password_confirm'?

For example, I have a form with the following fields:


email
password
password confirm


To apply a title attribute to the email element is fine...

$form['account']['mail']['#attributes']['title'] = 'enter your email address';


When I dump the contents of $form in search for the input elements for 'password_confirm', I only get the following:

[pass] =&gt; Array
                (
                    [#type] =&gt; password_confirm
                    [#size] =&gt; 25
                    [#description] =&gt; We will not spam you or give your email address to third parties.
                    [#required] =&gt; 1
                )


I'm not seeing 'pass1' and 'pass2' in the array. 

Please could someone point me in the right direction?
The password confirm element is converted to two fields in a process function (form_process_password_confirm()), so adding your own process function to the password element would do the trick.

Per this issue it seems you actually need to overwrite the existing #process array instead of just appending to it, e.g for the user register form password element:

function MYMODULE_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  $form['account']['pass']['#process'] = array(
    'form_process_password_confirm',
    'MYMODULE_password_confirm_process',
    'user_form_process_password_confirm'
  );
}

function MYMODULE_password_confirm_process($element) {
  $element['pass1']['#attributes']['title'] = 'Title';
  $element['pass2']['#attributes']['title'] = 'Title2';
  return $element;
}