Skip to content

Category: Questions

How to create rectangle using javascript or html

So basically i’m trying to display slots, when the user selects a location and clicks the check slot button . i’m trying to display rectangle when the Check Slot is clicked, similar to the attached image. Please refer the image Image . HTML CODE Answer Use CSS Grid You can use a Grid Layout to dis…

Can’t append simple svg to body element

I know this is a super easy question. But I am apparently missing something super obvious. I just want to create an svg element with D3 and see it on my page. My index.htmllooks like this: Whereas my selections.js looks like this: The first console.log() is still visible in the console. But I cant see the svg…

Putting label array to the chartjs?

I have these codes: let arr = []; This is what console.log(arr); shows: [“Item1”, “Item2”, “Item3”, “Item4”] Below is my graph: How can I loop through the object arr to be put inside the labels? Answer The charts label receives a string or an array of strings: S…