Unable to set placeholder on password input function customization_form_user_register_form_alter(&amp;$form, &amp;$form_state, $form_id) {
 $form['account']['pass']['#attributes']['placeholder'] = t('Password');
}


I am trying to set placeholder on password field in registration form.

I seted placeholder on username and email, but on password field won't work...

Any help? Thank you!
Wish I'd seen this sooner. You've probably moved on from this problem, but for the benefit of other people seeking an answer to this question: (obviously replace mymodule with the name of your module)

/**
* Implementation of hook_element_info_alter ()
*/
function mymodule_element_info_alter (&amp; $type)
{
  if (isset($type['password_confirm']['#process'])) {
    $func = '_mymodule_process_password_confirm';

    $type['password_confirm']['#process'][] = $func;
  }

  return $type;
}

/**
 * Do a bit of processing for the password_confirm element.
 * Original processing happens in expand_password_confirm()
 */
function _mymodule_process_password_confirm ($element)
{
  // Use the element's title, or create a custom title with the t() function.
  $element['pass1']['#attributes']['placeholder'] = $element['pass1']['#title'];
  $element['pass2']['#attributes']['placeholder'] = $element['pass2']['#title'];

  // Remove these lines if you want to keep the field labels.
  $element['pass1']['#title_display'] = 'none';
  $element['pass2']['#title_display'] = 'none';

  return $element;
}