My aim in the study is to generate random colors and apply them to the body background, but it doesn't work, why is it wrong?

enter image description here what is the problem here function or addeventlistener? ` const button = document.querySelector("button"); // Generate random color value and return it. EX 8a6cff const getRandomColor = () => Math.floor(Math.random() * 0xffffff).toString(16); const generateGradient = () => { // Get random two colors for gradient const color1 = getRandomColor(); const color2 =… Read More My aim in the study is to generate random colors and apply them to the body background, but it doesn't work, why is it wrong?

Can't add event when iterate a NodeList using javascript

I’m trying to iterate a NodeList  object using javascript, and i want to a click event to eatch item : document.addEventListener("DOMContentLoaded", async () => { try { posts.map(post => { container.innerHTML += outPutHtml(post); // user-interaction elements are created with ajax request } catch (e) { console.error(e); } finally { highlight.highlightAll(); }); const elements = document.querySelectorAll(".user-interaction");… Read More Can't add event when iterate a NodeList using javascript

addeventlistener getting eaten by subsequent uses

This is must be some strange js thing I’m not aware of, but why will this code only log if the last input field changes? (Id 3) Since I am adding the eventListeners to all input fields, I’d expect outputs from all of them… function constructInputs(ctx, id) { console.log(id); ctx.innerHTML += `<input type=”text” id=”${id}_textInput”></br>`; let… Read More addeventlistener getting eaten by subsequent uses

making to do application with JS but EventListener is not working after i press submit (still new to JS)

I am trying to make To-do application with JS everything works fine but i can’t delete after pressing submit and i don’t understand why , if anyone can help me would be greatful Here is a Code in code your text I Have checked the code but couldn’t figure it out So please Help! >Solution… Read More making to do application with JS but EventListener is not working after i press submit (still new to JS)

mouseover event litsener is not fireing when i move over elements

I’m trying to make a star rating system at an initial stage, the 5 star icon from font awesome deosn’t seem to fire when an even litsener to add to it, i don’t know what i’m doing wrong html ` <section class="mx-lg-3 pt-lg-5 pb-5" data-aos="fade-up"> <div class="container mt-5"> <div id="confirm-box">{% include "message.html" %}</div> <div class="row… Read More mouseover event litsener is not fireing when i move over elements