mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-27 02:09:37 +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;" }
|
||
)
|
||
);
|