World Lists

From ProgZoo
Revision as of 15:02, 16 January 2022 by Andr3w (talk | contribs) (Created page with "<pre id='shellbody' data-qtp='DOM'></pre> ==Create Content== <div class='qu'> You can create a div element an set the content. We use the document method '''createElement'''...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Create Content

You can create a div element an set the content.

We use the document method createElement and the DOM node method append

Change the code so that it says 'Hello world'
let e = document.createElement('div');
e.innerHTML = 'Hello';
document.body.append(e);
let e = document.createElement('div');
e.innerHTML = 'Hello world';
document.body.append(e);