Category "javascript"

How to fix Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') [duplicate]

I am adding an event listener to an HTML element, so that when you click on it the drop-down displays, but for some reason, I get the Uncaught

How to filter without using the filter method in javascript?

I have to convert 2 functions, both using filter methods into something using for loops, how am i supposed to do that ? For some case, it makes sense, but using

Hide Textbox with parameter name completely when the checkbox is disabled in UI

When I enable the checkbox, I've written a js function to enable the textbox to be adjustable; otherwise, it must be greyed out. Changes Made: When I enable the

How to Fix the TD elements of first column of the table body while the rows are scrolling?

The title is not clear, I know. Let me explain what I mean: First column has td elements which have varying rowspans. What I want is to keep the td text in firs

Filter by value in checkbox popup in Mapbox GL

I have changed my mind about how I want to use the Checkbox filter in Mapbox. I am using CSV2Geojson to map Google Sheets data in my map and then filter by valu

How to customize the color and fonts for microsoft Adaptivecards Input.choiceset

I'm using v1.2 of the AdaptiveCard SDK in BotFramework Webchat. I need to customize the color of the values of the Input.Choiceset of the Microsoft adaptive car

Integrating Frontend Javascript with Backend Node.Js and mySQL

I have tried searching around, but could not really find a solution to my question. Either that or I am not really understanding something properly. I have a pa

Override variable type from external library

I am using a third party library for my react application. There are some incorrect/outdated types. Let's say the library has the following type declarations: d

Qualtrics programming question (using javascript to create a bipolar slider)

I need to use bipolar sliders for a series of questions in Qualtrics. I saw some code on the Qualtrics community website to help get a label on the right hand s

How to set decimal input range using javascript or html?

I have an input and I need it to be limited to only these values: Min: 0.01 max 999.99 If I use maxlength="6" I can enter, for instance, 999.99 but also 1000.1

Create JSON dynamically with dynamic keys and values in Express Js

I am fetching API into my Express server which has several JSON key value pairs in one array. For Example: [{ "quality": "best", "url": "https://someurlhere.e

Check if string not in array in javascript

Yesterday I asked a question and, "with a little help from my friends" got my little javascript working. This one: <script type="text/javascript" > fu

Dynamically get value of specific element from list of elements with same id

So I'm trying to make a star rating feature and I'm stuck on setting the value dynamically from a variable. I don't want to make it so that the stars are intera

Drag an Element as a window

I have an element that contains a couple of elements and I want that while clicking on the green header of the element it will be dragged with the mouse movemen

VS code - How to remove quotes from keys only but value remains

What extension or shortcut will format a JavaScript object's keys without using quotation marks? I saw this in a presentation: They Pasted the example in A) bel

How do I prevent an event from triggering during a GSAP animation?

I have a GSAP animation like this: window.addEventListener('keydown', ()=>{ GSAP.to(this.box, { x: this.box.position.x + 4, duration: 1, }

Converting a splitted objects of object to array of objects

I have this form of data coming from an API and I want it to convert into different structure in JavaScript . [ { "1": { "id": 1, "coinname":

Why can I add named properties to an array as if it were an object?

The following two different code snippets seem equivalent to me: var myArray = Array(); myArray['A'] = "Athens"; myArray['B'] = "Berlin"; and var myObject =

How to upsert object in Mongoose Array?

I want to edit an array with mongoose, if the object id already exist in the array, then it will create a new one, and if it exist, it will update. My code: con

Using ImmerJS to update child (by id) within a parent (by id)

How do I update the content of child12 using immerJS const [fields, setFields] = useState([ { name: "Parent 1", id: "parent1", child