Relative Content

Tag Archive for javascriptarraysloops

Using a looped element as a new child in replaceChild() method

<!DOCTYPE html> <html lang=”en”> <head> <meta charset=”UTF-8″> <meta name=”viewport” content=”width=device-width, initial-scale=1.0″> <title>Document</title> <link rel=”stylesheet” href=”style.css”> <script src=”script.js” defer></script> </head> <body> <div class=”products”> <div class=”product”> <div class=”add-to-cart”>Add to cart</div> </div> <div class=”product”> <div class=”add-to-cart”>Add to cart</div> </div> </div> </body> </html> * { margin: 0; padding: 0; box-sizing: border-box; font-family: ‘Red Hat Text’; } body { display: […]

My code is working with or without loops and I want to know why

I tried copying the code but the website said it is not code but it runs in vs code and, also the AI I asked said that an array in java script cant be checked without using a loop but this one works fine with or without . a loop, why please I am frustrated.Please if you notice that I am doing things wrong please let me know.I am just a beginner. thank you

Object disappearing when created and reappearing upon refresh

I’m having this issue in my To-Do-List project. When creating a task in one of the projects the task wont appear, even though the id is the same and the array is populated? In AllTask, Important, Checked or Today the tasks will appear. For the task to appear again I have to refresh the page anyone knows why this happenes? Here’s the code: