World Lists
Jump to navigation
Jump to search
1) 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'
Input
xxxxxxxxxx
let e = document.createElement('div');
e.innerHTML = 'Hello';
document.body.append(e);
Output
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);