Skip to content

Tag: javascript

Building a keyboard and missing onclick event

I’m building a virtual keyboard with vanillla javascript but don’t know where to add the onclick event listener to the buttons or how to grab them. I have a printKeys function that loops thru the array and prints them onload, and I have an unfinished typeKeys function where I’m trying to gra…

How to convert an array of strings into a number?

I’m fetching data from an API which returns currency exchange rates like so: I was able to manipulate the fetched data using: const rate = Object.values(data).splice(11,5); which returns 1.044 However, my next problem comes when trying to parseFloat this object into a number.. for some reason it only re…

move a circle from one point to another

I’m new to leaflets and am trying to circle the map when clicked. I want conditions like the following: Circle moves from one point to another when clicked on the map (If the circle already exists and there is only one circle) Directly Zoom on where the circle is made However I have the following proble…