📅  最后修改于: 2022-03-11 15:03:21.146000             🧑  作者: Mango
ts// 1. Select the div element using the id property
const app = document.getElementById("app");
// 2. Create a new element programmatically
const p = document.createElement("p");
// 3. Add the text content
p.textContent = "Hello, World!";
// 4. Append the p element to the div element
app?.appendChild(p);