← 피드로
Hello Dev Community! 👋
Today marks Day 21 — exactly three full weeks of documenting my journey toward mastering the MERN stack! Today, I wrapped up Lecture 7 of Apna College’s JavaScript playlist with Shradha Didi, focusing on how to add and remove HTML nodes on the fly.
Up until yesterday, we could only manipulate elements that already existed in the HTML file. Today, I learned how to create components out of thin air using JavaScript!
🧠 Key Learnings From JS Lecture 7 (Part 3)
I explored the two-step process of adding new elements to the webpage layout:
1. Creating the Element
First, we must generate a new element node in the browser’s memory using:
javascript
let newBtn = document.createElement("button");
newBtn.innerText = "Click Me!";
Enter fullscreen mode Exit fullscreen mode
추출 본문 · 출처: dev.to · https://dev.to/ali_hamza_589ec7b3eb6688d/day-21-of-leaning-mern-stack-3lb6
답글 남기기