Skip to content

JavaScript triangle wrong direction how to make it correct?

I have a javascript question, I want to make a Triangle like this this is my code which makes opposite direction I wanna use for loop to make this triangle down bellow instead of using “repeat”. Answer You can write it like this: This method can be used in all other programming languages, cause th…

Switch…case in JS

This simple problem gives me an error. Does not get the correct answer. I will be glad if you help. Output: You did not pass Answer this way can you explain why we write true? – Hussein Nadjafli (PO) The JS switch only works on strict equality. is equivalent to in your code you replace the possible values [’x…

How to set the origin for a div?

Let’s say I have a div that follows the mouse cursor on my screen. This is done by handling the document mousemove event and setting its left and top position based on the event data. For this example let’s say it has a width and height of 10. It is desired for it to always be centered on the curs…

Problem with showing divs on click with Jquery

if you run my snippet and start clicking around you will be shown div’s like mercedes, boats or houses and that’s perfectly fine but problem is that when you first run this snippet nothing will be shown, you need to click something and that isn’t way to go. How can i make first div visible f…

Javascript not printing within php loop

new to php and javascript. I am trying to print an id using javascript within a php loop and nothing is turning up. Here is the code: Answer The problem is, that you want PHP to know, what printID() is and what it should do. PHP knows nothing about JavaScript functions, because JavaScript and PHP are executed…

Web page components animation

I’m a beginner learning front end development. I’m curious to know and learn how other developers create animated component like the one in below site. https://bzx.network/ Do we have a tool that will let us create this? Where I can learn these? I couldnot find the tool, right search keyword in go…

Error with menu button toggle css js html

I would like to use part of this code from codepen on my website but the menu button does not currently work. I do not know what the problem is so I have not tried anything to solve it. The code works flawlessly on codepen but stops working when use in visual studio. The HTML code is: The CSS: And