Skip to content

Tag: function

function to find an element inside the array [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 1 year ago. Improve this question I wrot…

How to create a div using JavaScript?

I have the following <div> which I have created using HTML and CSS. I don’t want these divs to be created when the page loads, instead I would like them to be created only when a JavaScript function is executed. I would prefer if they were actually created by the function, if possible, rather than…

Undo .removeAtribute function

I’m looking for a solution to restore a removed attribute. I’m not an experienced programmer, so I’m not sure where to start when sharing my code, so I’ll try to give some context below. I have an image of a map that has several hidden overlays. These overlays are activated by a series…

Double question javascript functions with arrays

This is a double question because I can just post once every 90 minutes. First I have to write a function that replaces a character of a string. And puts a space in place of the chosen character. I tried this but is not working. It returns just the same string. And the second thing is that I have to

How to use a TypeScript function in Javascript

I want to use the below given function called “translate” in a JavaScript file. I have seen a answer on stackoverflow regarding this, but couldn’t get what I had to do. Definitely the normal calling of function isn’t working in this case Answer If you’re using a typescript projec…