crop_rotate
Run
<!DOCTYPE html> <html> <head> <title>createElement JavaScript</title> </head> <body> <button type="button" id="button">Create Element</button> <script> let button = document.getElementById('button'); button.addEventListener("click",()=>{ // 1- Create new element let apple = document.createElement('h1'); // 2- Add Text to element apple.innerText = "Welcome To CloseTag.com"; // 3- Prepend Child to Parent body document.body.prepend(apple); }); </script> </body> </html>
PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCjxoZWFkPg0KPHRpdGxlPmNyZWF0ZUVsZW1lbnQgSmF2YVNjcmlwdDwvdGl0bGU+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPiA6Oi13ZWJraXQtc2Nyb2xsYmFye3dpZHRoOjdweDtoZWlnaHQ6N3B4O306Oi13ZWJraXQtc2Nyb2xsYmFyLXRyYWNre2JhY2tncm91bmQ6I2ZmZjt9Ojotd2Via2l0LXNjcm9sbGJhci10aHVtYntib3JkZXItcmFkaXVzOjVweDtiYWNrZ3JvdW5kOiMyZjQ1ZmY7fTwvc3R5bGU+PC9oZWFkPg0KPGJvZHk+DQogICA8YnV0dG9uIHR5cGU9ImJ1dHRvbiIgaWQ9ImJ1dHRvbiI+Q3JlYXRlIEVsZW1lbnQ8L2J1dHRvbj4NCiAgICA8c2NyaXB0Pg0KICAgIGxldCBidXR0b24gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnYnV0dG9uJyk7DQogICAgYnV0dG9uLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIiwoKT0+ew0KICAgICAgICAvLyAxLSBDcmVhdGUgbmV3IGVsZW1lbnQNCiAgICAgICAgbGV0IGFwcGxlID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnaDEnKTsNCiAgICAgICAgLy8gMi0gQWRkIFRleHQgdG8gZWxlbWVudA0KICAgICAgICBhcHBsZS5pbm5lclRleHQgPSAiV2VsY29tZSBUbyBDbG9zZVRhZy5jb20iOw0KICAgICAgICAvLyAzLSBQcmVwZW5kIENoaWxkIHRvIFBhcmVudCBib2R5DQogICAgICAgIGRvY3VtZW50LmJvZHkucHJlcGVuZChhcHBsZSk7DQogICAgfSk7DQogICAgDQogICAgPC9zY3JpcHQ+DQo8L2JvZHk+DQo8L2h0bWw+