Reorganize files

This commit is contained in:
2024-06-18 14:36:46 -04:00
parent a98d4bada5
commit 78ed72234a
3 changed files with 45 additions and 36 deletions

26
vanillaJS/index.html Normal file
View File

@@ -0,0 +1,26 @@
<html>
<body>
<div id="app"></div>
<br />
<button id="loadButton">Load More</button>
<script type="text/javascript">
const app = document.getElementById('app');
const loadButton = document.getElementById('loadButton');
function addElem(element, contents, attrs = {}) {
const newElem = document.createElement(element);
newElem.appendChild(document.createTextNode(contents));
for(const [key, value] of Object.entries(attrs)) {
newElem.setAttribute(key, value);
}
app.appendChild(newElem);
}
function addBlurb() {
addElem('h1', 'Fart Man comes to town!');
addElem('p', 'Will this controversial figure finally cause the downfall of the town? Sally Smith from town center says that she can already smell trouble brewing but other members of the town believe the imminent winds of change will revitalize the towns central business district.');
addElem('a', 'Read more...', {href: "#"});
}
addBlurb();
loadButton.addEventListener("click", addBlurb);
</script>
</body>
</html>