Created
November 13, 2017 19:03
-
-
Save nikkaroraa/271c2a05127c76bb73fe76fa986fa062 to your computer and use it in GitHub Desktop.
Updating DOM Nodes
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>DOM Manipulation</title> | |
| </head> | |
| <body> | |
| <p id="paraId">First Paragraph</p> | |
| </body> | |
| <script> | |
| //accessing the node with id="paraId" | |
| var firstPara = document.querySelector('#paraId'); | |
| //updating the text of the node | |
| firstPara.innerText = 'Modified Paragraph'; | |
| </script> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment