Created
August 31, 2024 16:33
-
-
Save randomrawat/1a9a527c8f08475654649255863991d3 to your computer and use it in GitHub Desktop.
Code in vanilla JS by creating and appending an h1 to our div#root (without using innerHTML)
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
const h1 = document.createElement("h1") | |
h1.textContent = "This is an imperative way to program" | |
h1.className = "header" | |
document.getElementById("root").append(h1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment