diff --git a/core/includes/form.inc b/core/includes/form.inc
index 9190e31..2ff2bde 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -375,12 +375,12 @@ function template_preprocess_textarea(&$variables) {
  *   properly navigate through forms but can be visually distracting. This
  *   property hides the label for everyone except screen readers.
  * - attribute: Set the title attribute on the element to create a tooltip
- *   but output no label element. This is supported only for checkboxes
- *   and radios in
- *   \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement().
- *   It is used where a visual label is not needed, such as a table of
- *   checkboxes where the row and column provide the context. The tooltip will
- *   include the title and required marker.
+ *   but output no label element. This is supported for checkboxes and radios in
+ *   \Drupal\Core\Render\Element\CompositeFormElementTrait::preRenderCompositeFormElement(),
+ *   and all other elements in template_preprocess_form_element(). It is used
+ *   where a visual label is not needed, such as a table of checkboxes where the
+ *   row and column provide the context. The tooltip will include the title and
+ *   required marker.
  *
  * If the #title property is not set, then the label and any required marker
  * will not be output, regardless of the #title_display or #required values.
@@ -430,6 +430,15 @@ function template_preprocess_form_element(&$variables) {
 
   $variables['title_display'] = $element['#title_display'];
 
+  // Set the element's title attribute to show #title as a tooltip, if needed.
+  if (isset($element['#title']) && $element['#title_display'] == 'attribute') {
+    $variables['attributes']['title'] = $element['#title'];
+    if (!empty($element['#required'])) {
+      // Append an indication that this field is required.
+      $variables['attributes']['title'] .= ' (' . t('Required') . ')';
+    }
+  }
+
   $variables['prefix'] = isset($element['#field_prefix']) ? $element['#field_prefix'] : NULL;
   $variables['suffix'] = isset($element['#field_suffix']) ? $element['#field_suffix'] : NULL;
 
