Fix the usage of `document.createElement`
authorAlexander Ebert <ebert@woltlab.com>
Fri, 23 Feb 2024 13:53:34 +0000 (14:53 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 23 Feb 2024 13:53:34 +0000 (14:53 +0100)
See https://www.woltlab.com/community/thread/304959-fehler-in-der-javascript-doku/

docs/javascript/components_confirmation.md

index ea9efd56a0a226f1ba1d9822d252aba0a91171a6..e01819d67b17d2c0fafd220ce1cdda68c0c50cb4 100644 (file)
@@ -124,7 +124,8 @@ Some dialogs require additional input elements, for example, the prompt to remov
 const { result, dialog } = await confirmationFactory()
   .custom(theQuestionToAsk)
   .withFormElements((dialog) => {
-    const p = document.createElement("<p>Hello World</p>");
+    const p = document.createElement("p");
+    p.textContent = "Hello World";
     dialog.content.append(p);
   });
 if (result) {