Created
June 4, 2019 21:18
-
-
Save marcusp619/10a186b0991e3183daee5c10ae8a8ff4 to your computer and use it in GitHub Desktop.
wbZWXM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>DOM Maniupulation</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make a new element | |
const myElement = document.createElement('h1'); | |
// add some text to that element | |
// myElement.innerHTML = "Lorem ipusm"; | |
myElement.textContent = "Lorem ipsum" | |
// we append that element to the DOM | |
const theBody = document.querySelector('body') | |
theBody.appendChild(myElement) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment