mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-07-04 05:32:13 +02:00
🔤
This commit is contained in:
@ -2,14 +2,14 @@
|
||||
const div = document.createElement('div');
|
||||
const h1 = document.createElement('h1');
|
||||
h1.textContent = 'Title';
|
||||
div.appendChild(h1);
|
||||
div.append(h1);
|
||||
|
||||
const p = document.createElement('p');
|
||||
p.textContent = 'Paragraph';
|
||||
div.appendChild(p);
|
||||
div.append(p);
|
||||
|
||||
// appendChild doesn't return parent
|
||||
// append doesn't return parent
|
||||
// so chaining is not possible
|
||||
|
||||
// Add to DOM
|
||||
document.body.appendChild(div);
|
||||
document.body.append(div);
|
||||
|
Reference in New Issue
Block a user