mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-22 16:55:23 +01:00
15 lines
309 B
JavaScript
15 lines
309 B
JavaScript
document.body.append(
|
||
document.createElement("div")
|
||
);
|
||
console.log(
|
||
"Emty div is generated inside <body>:",
|
||
document.body.innerHTML.includes("<div></div>")
|
||
);
|
||
|
||
document.body.append(
|
||
Object.assign(
|
||
document.createElement("p"),
|
||
{ textContent: "Element’s text content.", style: "color: coral;" }
|
||
)
|
||
);
|