Created
October 31, 2018 17:06
-
-
Save bl4de/c832954f5f2267f459e9653dcf1f2447 to your computer and use it in GitHub Desktop.
A simple website with dynamically added P element
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
<html> | |
<head> | |
<title>Dynamic P Application</title> | |
<style> | |
* { | |
font-size:18px; | |
font-weight:bold; | |
color: #2e2e2e; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="container"> | |
</div> | |
<script> | |
const el = document.getElementById('container') | |
const dynamic_paragraph = document.createElement('p') | |
const dp_content = document.createTextNode('Hello from dynamically added <P>aragraph!') | |
dynamic_paragraph.appendChild(dp_content) | |
el.appendChild(dynamic_paragraph) | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment