Skip to content

Category: Questions

Dynamically populating HTML with JavaScript objects

I have a js file containing data in the form of objects : I want to recreate the below structure dynamically: I want to do this with only JavaScript. I tried appending and creating new elements but I have to do it for each object. I think I am to create a function that loops through all the objects and

Dynamically append input where mouse clicked

I’m trying to show an input where my house clicked, if I don’t enter anything in the put, the input will show in the next mouse click. Somehow, I can’t seems to type inside that input. I have Answer if your problem just you can’t type , you need to focus input Add $(“input”…

Quiz options not displaying for my quiz app

I’m developing a quiz app and there is two main function: fetchData This function will fetch questions from a API and display everything to the webpage. isCorrect This function will check if the answer is correct typed by the user. If it is, add 1 to the score variable. But when the first function runs,…

Dynamically append DOM where mouse clicked

I have a page where I want to dynamically add a pin/marker wherever I clicked. I’ve tried $(“body”).click(function(e) { console.log(“%c ______________________________”, “background: linear-…

Double stack navigation headers

My app is showing 2 headers. I want only one header the tutorial I was following worked fine but not for me. the tutor was using react navigation v5, I am using v6. here’s the code that might wanna …

Listen for modal close event from another file

Can I listen for jquery modal close event from another file? I created the modal in a different PHP file and when I use the event listener in my modal PHP file it works but when I use it like below it doesn’t work. The modal hide function is called in the CreateUserModal.php. What I want to happen is wh…