A simple task can be given to all learners, such as creating a to-do list as follows: A heading, an empty tag, an along with a to add an element, and a reset to remove all list items I have created it, and it's surprising to see that you already covered all the things that will be needed to create it except getting value from the input field. For it, I used the `.value` property on the input element. 👍🚀
How can we save the entire file after dynamic manipulation so that if I reload all the changes like added elements should be visible I mean it shouldn't be deleted on reload of index.html. As I have taken it up it deleted every changes and file was undo as previous. ?? Sorry for question goes lengthy 😂
No one could have explained it better Thank you so much
A simple task can be given to all learners, such as creating a to-do list as follows:
A heading, an empty tag, an along with a to add an element, and a reset to remove all list items
I have created it, and it's surprising to see that you already covered all the things that will be needed to create it except getting value from the input field. For it, I used the `.value` property on the input element. 👍🚀
Yes I have made simple one
Document
Enter your List
Click to Add!
const but = document.getElementById("button-click")
const cont = document.getElementById("container")
const count = 1
// console.log(but)
but.addEventListener("click",()=>{
const val = document.getElementById("input-id")
console.log(val.value)
const ele = document.createElement("h1")
ele.innerHTML = count +". "+ val.value
cont.appendChild(ele)
count++
val.value = ""
})
Feel free to use it
@@AnkitKumar-pk8tk everything is great, just make the count variable as let instead of const.
Very informative 👍
Keep up the good work ...
Thank you buddy.
How can we save the entire file after dynamic manipulation so that if I reload all the changes like added elements should be visible I mean it shouldn't be deleted on reload of index.html. As I have taken it up it deleted every changes and file was undo as previous. ??
Sorry for question goes lengthy 😂
You can save the data in local storage or DB and re-render all dom on page load.
thanks you sir
Bhai ek issue hota hai dynamically created elements ke sath.
Events kam nahi karte hai uspe.
How do we handle it?
I’ll add it to upcoming videos
Thanks
@@piyushgargdev thank you to bhai ❤️
Karte hai bro .... Either aap loops ke through run karo ya fir ID's ko target karke