diff --git a/core/modules/file/src/Element/ManagedFile.php b/core/modules/file/src/Element/ManagedFile.php
index 0077716..4557f02 100644
--- a/core/modules/file/src/Element/ManagedFile.php
+++ b/core/modules/file/src/Element/ManagedFile.php
@@ -160,9 +160,9 @@ public static function uploadAjaxCallback(&$form, FormStateInterface &$form_stat
     if (isset($form['#file_upload_delta']) && $current_file_count < $form['#file_upload_delta']) {
       $form[$current_file_count]['#attributes']['class'][] = 'ajax-new-content';
     }
-    // Otherwise just add the new content class on a placeholder.
+    // Otherwise just add the class to the container.
     else {
-      $form['#suffix'] .= '<span class="ajax-new-content"></span>';
+      $form['#attributes']['class'][] = 'ajax-new-content';
     }
 
     $status_messages = ['#type' => 'status_messages'];
