Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Adding Hello World #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/exercise/01.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<!-- http://localhost:3000/isolated/exercise/01.html -->

<!-- 🐨 Create (in HTML) a <body> with a <div> with the id of "root" -->

<!-- 🐨 Then create a <script type="module"> for your JavaScript -->
<!-- 📜 https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script#attributes -->
<!-- 📜 https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules -->
Expand All @@ -16,3 +17,14 @@
<!-- 🐨 Append the div to the root div using `append` -->
<!-- 💰 document.getElementById('root') -->
<!-- 📜 https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/append -->
<body>
<div id="root">
<script type="module">
let rootElement = document.getElementById("root")
let div = document.createElement("div")
div.textContent = "Hello World"
div.className = "container"
rootElement.append(div)
</script>
</div>
</body>